## Solution to Genomic-Range-Query by codility

21 Jan

Question: http://codility.com/demo/take-sample-test/genomic_range_query Question Name: GenomicRangeQuery This is a typical case that uses more space for less time.

## Solution to Passing-Cars by codility

20 Jan

Question: http://codility.com/demo/take-sample-test/passing_cars Question Name: PassingCars

## Solution to Max-Counters by codility

19 Jan

Question: http://codility.com/demo/take-sample-test/max_counters Question Name: MaxCounters A straightforward solution is easy as following. But the expected worst-case time complexity cannot be guaranteed.

We could use lazy-write to improve the performance. When receiving the max_counter command, we record the current-max value, … Read More »

## Solution to Frog-River-One by codility

19 Jan

Question: https://codility.com/demo/take-sample-test/frog_river_one Question Name: FrogRiverOne If coding with C, bitmap is preferred to store which positions are covered.

## Solution to Perm-Check by codility

19 Jan

Question: http://codility.com/demo/take-sample-test/perm_check Question Name: PermCheck This question is a simple variant of the counting question. The Python solution is:

The Java solution is:

## Solution to Tape-Equilibrium by codility

16 Jan

Question: http://codility.com/demo/take-sample-test/tape_equilibrium Question Name: TapeEquilibrium The variable of head stores the sum of the heading part of the tape. And the variable of tail stores the sum of tailing part. Then, we move the index from 2nd position to the … Read More »

## Solution to Perm-Missing-Elem by codility

16 Jan

Question: http://codility.com/demo/take-sample-test/perm_missing_elem Question Name: PermMissingElem or PermMissingElement The main challenge of this question is the XOR operations: X^X=0, and 0^X=X. Logically, the addition and subtraction operations also are able to do this work. But taking the overflow in computer into … Read More »

## Solution to Frog-Jmp by codility

15 Jan

Question: https://codility.com/demo/take-sample-test/frog_jmp Question Name: FrogJmp This is a very easy question. If with C, one statement is enought. UPDATE on 2017/11/29: Codility changed Python from 2.X to 3.X. So the integer division needs to be updated to “//” from “/”. … Read More »