You are provided with an array in which all elements are repeated thrice except one which is repeated twice.
Your task is to print that number.
You are given an array. Your task is to sort the array in given manner.
Print the elements in increasing order of the frequency.
If frequency is same print smaller one first.
You are given with an array of numbers,
Your task is to print the difference of indices of largest and smallest number.All number are unique.
You are a passport issuer, but due to some problems in the system, there are redundant passport numbers.
Your task is to delete all the duplicate passport numbers. You are given a list of passport numbers.
A person saves his monthly saving according to given schema.
He saves same amount of money which is equal to the money saved in immediate previous two months.
Assume, initially he saved 1000 rupees and in first month he saved another 1000.
Your task is to tell how much he had totally saved at the end of ‘n’ months
Assume you are a student studying in school.
You are given a task to find first negative integer for each and every window of size k.
Find the first 0 in window of size k. You are given n numbers and window size ‘w’
Your task is to print the first index which has 0
You are given an array of numbers. Print the least occurring element.
If there is more than 1 element print all of them in decreasing order of their value.
You are given with an circular array .Your task is calculate the difference between two consecutive number.
And if difference is greater than ‘k’, print 1 else print 0
You are given with two arrays.
Your task is to merge the array such that first array is in ascending order and second one in descending order.
You are given with an array.
For each element present in the array your task is to print the next smallest than that number.
If it is not smallest print -1
Indian politics has an interesting trend in history. A party which assumes that it is the undefeatable
champion in elections has been defeated by other parties in many instances.
You are a data analyst in the Election Commission. You are given a list containing a year and the party
which won the election in that particular year. Your task is to analyse the trend and find the years in which,
one party, which won many elections consecutively, was suddenly defeated by another.
Given two numbers N,K followed by an array of N elements,
print the array after doing right shift K times (in cyclic manner).
Input Size : 1 <= N, K <= 100000