Close

Problem of candies: SPOJ

This problem is from SPOJ (Sphere Online Judge – A site to practice your problem solving skills). If you want to solve this problem on your own, please follow the link.The simplified problem description is as follows.  A teacher has n packets of candies of varying sizes. The problem is to find the number of…

Number of matching pairs

This problem is from Codeforces. If you want to solve this problem on your own. Follow the link.Following is the abridged(simplified) problem statement for the above problem.Given an array containing values in the range [-10,10], find out how many number of matching pairs are possible? A pair of numbers is said to be matching if…