## Solution to Peaks by codility

26 Jan

Question: http://codility.com/demo/take-sample-test/peaks Question Name: Peaks UPDATE on July 18th 2015: Many thanks to @Antonio Correia (https://34.145.67.234/2014/solution-to-peaks-by-codility/#comment-11725) !!! @Antonio Correia found a huge bug in my solution, even though it passed the codility.com. The bug has been fixed.

## Solution to Min-Perimeter-Rectangle by codility

26 Jan

Question: http://codility.com/demo/take-sample-test/min_perimeter_rectangle Question Name: MinPerimeterRectangle Let the length of one side be len_1, and the length of one adjacent side be len_2. For a rectangle with a constant area, the perimeter is minimized when the difference between len_1 and len_2, … Read More »

## Solution to Max-Slice-Sum by codility

26 Jan

Question: http://codility.com/demo/take-sample-test/max_slice_sum Question Name: MaxSliceSum The classic maximum subarray problem. It should be the very first question in this lesson.

## Solution to Max-Profit by codility

25 Jan

Question: http://codility.com/demo/take-sample-test/max_profit Question Name: MaxProfit For this question, we have to travel from the last element to the first one.

## Solution to Max-Double-Slice-Sum by codility

25 Jan

Question: http://codility.com/demo/take-sample-test/max_double_slice_sum Question Name: MaxDoubleSliceSum A variant of the classic maximum subarray problem. We should travel the array twice. For the first travel, we compute and record the maximum sub-array sum, which ends at each position. At the second reverse … Read More »

24 Jan

## Solution to Dominator by codility

24 Jan

Question: http://codility.com/demo/take-sample-test/dominator Question Name: Dominator Same question in the introduction pdf.

## Solution to Fish by codility

23 Jan

Question: http://codility.com/demo/take-sample-test/fish Question Name: Fish UPDATE 03-14-2014: “downstream_count” is a redundant variable. It could be replaced with len(downstream) safely. (Thanks to the reminder fromÂ Max)

## Solution to sigma2012 (Stone-Wall) by codility

23 Jan

Question: http://codility.com/demo/take-sample-test/stone_wall Question Name: sigma2012 or StoneWall

## Solution to Nesting by codility

22 Jan

Question: http://codility.com/demo/take-sample-test/nesting Question Name: Nesting This question is nearly the same as the previous one, but does not need a stack.