Solution to Common-Prime-Divisors by codility

18 Feb

Question: https://codility.com/demo/take-sample-test/common_prime_divisors Question Name: CommonPrimeDivisors

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 »