Close

## Odd number out

Given an array of numbers which contains all even numbers except one, or all add numbers except one. How do you find the different number? For example consider the array [1, 2, 3, 5, 9], 2 is the different number. Similarly in the array [10, 6, 7, 24, 36], 7 is the different number. This…

## Minimum area of a square enclosing given set of points

Problem: Given a set of coordinates in a two dimensional plane, How do we find the area of a minimum square which includes all the points. The points can exist on the border also. For example consider two points (0,0), (1,2) we need a minimum 2*2 square to cover these points. Hence the area is…

## Finding a sub list with least max-min difference – Codeforces puzzle

This is a problem from Codeforces. Please follow this link to solve this problem on your own. The abridged problem statement is as follows. You are given an list of numbers, and sub-list size as input. The challenge is to find a sub-list such that the difference between the maximum and minimum numbers in that…

## Next Round – A problem from Codeforces

This problem is from Codeforces. If you want to solve this problem on your own, follow this link. Here is the simplified problem statement. Given a list of scores of contestants in a competition, arranged in decreasing order. We have to calculate the number of people qualified for the next round.This is determined as follows,…

## Inverse permutation problem

This problem is from code forces. If you want to try this problem, follow this link. Here is the simplified problem statement. Given a group of N friends, each one has given a gift to other friend or themselves. An input array is given which indicates from whom each one has received their gifts. We…

## Continuous sequence

This problem is from codeforces. If you want to solve this problem on your own. Please head over here and solve it!The simplified problem statement is as follows.Given a sequence of 0 and 1s. Check if contains a continuous sequence of 0/1 of length 7.For example see some input output combinations Input                             Output—————————————— 10001010010011                    NO1000000001100                    …

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