solutions for quick sort and count pairs

Signed-off-by: Archan Mishra <archanmishra@gmail.com>