Given a large number N, the task is to find the factorial of N using recursion....
Given an array arr[], the task is to find the minimum cost to remove all elements from the array where the cost of removing an element is 2^j * arr[i]. Here, j is the number of elements that have already been removed....
Given an array arr[] of size N and an integer K. The task is to find the last remaining element in the array after reducing the array. The rules for reducing the array are:...
Given a string S, the task is to find the count of maximum repeated frequency of characters in the given string S.Examples:...
Given a range [L, R], the task is to find a pair (X, Y) such that L ? X, Y ? R and (X | Y) is maximum among all the possible pairs then print the bitwise OR of the found pair.Examples:...
Given two positive integers A and B such that A != B, the task is to find a positive integer X which maximizes the expression (A AND X) * (B AND X).Example:...
Given integers k, d1, d2 and an integer array arr[]. Starting from number k you are allowed to make jumps of size d1 and d2 i.e. all the possible moves from k are:...
Given an array balls[] representing the count of colored balls labeled from 1 to k, the task is to determine the number of ways to draw the last ball of color i before drawing the last ball of color i + 1 for all i from 1 to k – 1....
Given two integers M and K and an array arr[] consisting of N positive integers, the task is to check if the array can be split into K consecutive non-overlapping subarrays of length M such that each subarray consists of a single distinct element. If found to be true, then print “Yes”. Otherwise, print “No”....
Given an integer N, the task is to tile a board of dimensions N * 1 the task is to count the number of ways to tile a board using tiles of dimensions 1 * 1 and 2 * 1....
Given two positive integers S and X which represents the sum and Bitwise XOR of all the elements of an array arr[]. The task is to find the elements of the array arr[]. If no such array can be generated, print -1.Examples:...
Given an array arr[] of positive integers, the task is to find whether it is possible to make this array strictly decreasing by modifying at most one element.Examples:...