Solution to Cyclic-Rotation by codility

9 Feb

Question: https://codility.com/demo/take-sample-test/cyclic_rotation/ Question Name: Cyclic-Rotation or CyclicRotation With Python’s syntactic sugar, the solution is pretty short.

Well, kind of too easy. Let’s try a C++ solution to demo the details better. Thanks to @micropentium6, the original C++ solution is … Read More »

Solution to Reverse Words in a String by LeetCode

27 Jul

Question: https://oj.leetcode.com/problems/reverse-words-in-a-string/ Question Name: Reverse Words in a String To solve it with Python, it is as simple as one statement.

But is there a better way? Anyone, who read the excellent book Programming Pearls before, might remember Doug McIlroy’s … Read More »