## Solution to Max-Nonoverlapping-Segments by Codility

4 Sep

Question: https://codility.com/demo/take-sample-test/max_nonoverlapping_segments/ Question Name: Max-Nonoverlapping-Segments or MaxNonoverlappingSegments It is an easy solution, but a bit hard to prove it. Let’s scan from left to right, according to the end points. Since the input has already been sorted with the end … Read More »

## Solution to Delta2011 (Min-Abs-Sum) by codility

29 Jul

Question: https://codility.com/demo/take-sample-test/delta2011 Question Name: Delta2011 or Min-Abs-Sum or MinAbsSum I did not solve it in a golden way. The official solution is so elegant.

## Solution to Str-Symmetry-Point by codility

28 Jul

Question: https://codility.com/demo/take-sample-test/str_symmetry_point Question Name: Str-Symmetry-Point or StrSymmetryPoint

## Solution to Tie-Ropes by codility

28 Jul

Question: https://codility.com/demo/take-sample-test/tie_ropes Question Name: Tie-Ropes or TieRopes

## Solution to Count-Factors by codility

28 Jul

Question: https://codility.com/demo/take-sample-test/count_factors Question Name: Count-Factors or CountFactors

## Solution to Missing-Integer by codility

28 Jul

Question: https://codility.com/demo/take-sample-test/missing_integer Question Name: Missing-Integer or MissingInteger

## Solution to psi2012 (Wire-Burnouts) by codility

28 Apr

Question: https://codility.com/demo/take-sample-test/wire_burnouts Question Name: psi2012 or Wire-Burnouts or WireBurnouts A good application of weighted quick union algorithm.

## Solution to Min-Abs-Sum-Of-Two by codility

21 Apr

Question: https://codility.com/demo/take-sample-test/min_abs_sum_of_two Question Name: Min-Abs-Sum-Of-Two or MinAbsSumOfTwo There are two O(nlogn) solutions for this question. Both solutions have the same overall time complexity and space complexity. And both solutions need to sort the array in non-decreasing order first. The first … Read More »

## Solution to Count-Distinct-Slices by codility

17 Apr

Question: https://codility.com/demo/take-sample-test/count_distinct_slices Question Name: Count-Distinct-Slices or CountDistinctSlices

## Solution to Count-Triangles by codility

17 Apr

Question: https://codility.com/demo/take-sample-test/count_triangles Question Name: Count-Triangles or CountTriangles This problem is nearly the same as the exercise in presentation of lesson 13. Update on May 24, 2014: Thanks to @Adam. Fix a bug, which lower the performance.