Solve PA#2, that count number of comparisons in quicksort