Solution to chi2012 (Cannonballs) by codility

7 Feb

Question: https://codility.com/demo/take-sample-test/chi2012/ Question Name: chi2012 or Cannonballs

Solution to gamma2011 (Count-Palindromic-Slices) by codility

5 Feb

Question: https://codility.com/demo/take-sample-test/count_palindromic_slices Question Name: CountPalindromicSlices This task is based on the longest palindromic substring question, which has a good solution naming Manacher’s algorithm. Some explanation about the algorithm could be found here (English) and here (Chinese).

Solution to Array-Inversion-Count by codility

4 Feb

Question: https://codility.com/demo/take-sample-test/array_inversion_count Question Name: ArrayInversionCount

UPDATE on July 18, 2014: Thanks to @Andrew, there is another solution with Binary Indexed Tree. UPDATE on October 8, 2014: Thanks to @Piotrek Martynowicz, there was a bug for the statement: “computes the … Read More »

Solution to omega2013 (Falling-Disks) by codility

4 Feb

Question: https://codility.com/demo/take-sample-test/falling_disks Question Name: omega2013 or FallingDisks

Solution to Equi by codility

2 Feb

Question: https://codility.com/demo/take-sample-test/equi Question Name: Equi The expected worst-case space complexity could be less than required.

Solution to Tree-Height by codility

29 Jan

Question: https://codility.com/demo/take-sample-test/tree_height Question Name: TreeHeight Classic recursion problem.