## 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 »

## Set Up a Private Airfare Watchdog by Your Own

11 Nov

There are some public airfare watchdogs online. But we still have tons of reasons to set up a private one. For example, we do not want to share our email address, considering privacy and/or spam. Additionally, private watchdog has quicker … Read More »

## Find a Duplicate Item In an Array of Shuffled Consecutive Integers

16 Mar

Question: if you hava an array with n integers. These integers are in random order. And each interger is between 1 and n-1, including 1 and n-1. Additionally, there is one and only one integer, which appears twice, while all … Read More »

## An Example of Python and libpcap (pcapy)

26 Oct

Long long ago, I wrote this piece of code, with Python and pcapy, for my project. Today I put it on my blog, partly for recording, and partly for memento. This program read the data in libpcap file format, filter … Read More »