Blog is coming back :-)

14 Nov

This little blog is served on Google Cloud. Since the last day of October, it was stopped by my mistake and I cannot restart the service. Google Cloud always complains: Operation type [start] failed with message “The zone ‘projects/???/zones/us-west2-b’ does … Read More »

Solution to Rectangle-Builder-Greater-Area by codility

20 Nov

Question: Question Name: Rectangle-Builder-Greater-Area or RectangleBuilderGreaterArea This key is the binary search.

Solution to Dwarfs-Rafting by codility

19 Nov

Question: Question Name: Dwarfs-Rafting or DwarfsRafting Need some simple mathematical knowledge. The code is unnecessarily long. A 2-d array is better to write much shorter code. However, I keep the long version for better readability.

Solution to Slalom-Skiing by codility

22 Oct

Question: Question Name: Slalom-Skiing or SlalomSkiing This is a wonderful variant of longest increasing subsequence. Because the longest increasing subsequence is a very classic question withe O(NlogN) solution, the key point to solve this question is to covert its original form … Read More »

Solution to Flood-Depth by codility

25 Sep

Question: Question Name: Flood-Depth or FloodDepth This is a variant of Trapping Rain Water by LeetCode. The undergoing concept is the same. However, the implementation is a bit different.

Solution to Longest-Password by codility

22 Sep

Question: Question Name: Longest-Password or LongestPassword The solution could be more Pythonic with some additional space.

Solution to Sql-Sum by codility

21 Sep

Question: Question Name: Sql-Sum or SqlSum This question is too easy to be a serious training lesson. Most likely, it’s a live test for SQL challenges on The following solution works in both PostgreSQL and SQLite.