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: