A public repository for hosting my coding jokes and challenges !!!
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 !!!