##
Sort an array after applying the given equation
May 20, 2017

We have an integer array that is sorted in ascending order. We also have 3 integers A, B and C. We need to apply A*x*x… Read More »

May 20, 2017

We have an integer array that is sorted in ascending order. We also have 3 integers A, B and C. We need to apply A*x*x… Read More »

May 19, 2017

TimSort is a sorting algorithm based on Insertion Sort and Merge Sort. A stable sorting algorithm works in O(n Log n) time Used in Java’s… Read More »

May 18, 2017

Given an array of n integers. The task is to remove or delete minimum number of elements from the array so that when the remaining… Read More »

We are given an unsorted array of integers in the range from 0 to n-1. We are allowed to swap adjacent elements in array many… Read More »

Given a string containing characters as integers only. We need to delete all character of this string in a minimum number of steps where in… Read More »

May 17, 2017

Given many stacks of coins which are arranged adjacently. We need to collect all these coins in the minimum number of steps where in one… Read More »

Given a date and a positive integer x. The task is to find date after adding n days to the given date Examples: Input :… Read More »

Given a number, determine whether it is a valid Hyperperfect Number. A number n is called k-hyperperfect if: n = 1 + k ∑idi where… Read More »

May 16, 2017

We are given an array of strings, we need to sort the array in increasing order of string lengths. Examples: Input : {“GeeksforGeeeks”, “I”, “from”,… Read More »

Given N modular equations: A ≅ x1mod(m1) . . A ≅ xnmod(mn) Find x in the equation A ≅ xmod(m1*m2*m3..*mn) where mi is prime, or… Read More »

Given a number n, find the first k digits of nn, where k is a value less than the number of digits in nn Input… Read More »

May 15, 2017

Write a tail recursive function for calculating the n-th Fibonacci number. Examples: Input : n = 4 Output : fib(4) = 3 Input : n… Read More »

Given a integer ‘x’, find the number of values of ‘a’ satisfying the following conditions: 0 <= a <= x a XOR x = a… Read More »

Given a string of distinct characters, print all possible strings of any length that can be formed from given string characters. Examples: Input : abc… Read More »

May 14, 2017

An element is a peak element if it is greater than or equal to its four neighbors, left, right, top and bottom. For example neighbors… Read More »