Skip to content

papiveron/topcoding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Nixmind TOPCODING

A public repository for hosting my coding jokes and challenges !!!

String Compress

strcompress folder is about a google interview question I've seen many people talking about in many web site and forums. The problem to solve is : Compress string "aabcaaaaade" to "aabc5xade". Only compress if it shortens the string. 5xa means char a is repeated 5 times

I took about a half hour at work during my launch time to write and test two solutions:

  • The first one str_compress uses no specific python module, and only nativ e builtins
  • The second one str_compress_re uses python re module.

At the time of this first commit I didn't yet benckmark the two solutions ecution time, so feel free to do it. I tried to compress special french characters in the example of the second solution, but it doesn't work in this first commit ;)

Any coding mistake or advises are well come !!!

About

General purposes and challenge code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages