Given a range of values [L, R] and a value K, the task is to count the numbers in the given range which are divisible by at least K of the digits present in the decimal representation of that number....
Given a number n, we need to print all n-digit binary numbers with equal sum in left and right halves. If n is odd, then mid element can be either 0 or 1....
Given an array of non-negative integers. Choose an integer P and take XOR of P with all elements of the array. The task is to choose P such that the maximum value of the array is minimum possible after performing XOR of all elements of the array with P....
Given a Binary Tree, the task is to print all root-to-leaf paths of this tree whose xor value is non-zero....
Given the current position of a Knight as (i, j), find the count of different possible positions visited by a knight after N moves (in a 10 x 10 board)....
Given a string S of length N, consisting of lowercase English alphabets only, the task is to find the minimum possible length of run-length-encoding that can be generated by removing at most K characters from the string S....
Given two positive integers N and K, the task is to find the Kth character of a string obtained by performing the following operation on a string S( initially “A”) N times....
Given a number K, and N bars of height from 1 to N, the task is to find the number of ways to arrange the N bars such that only K bars are visible from the left....
Given an N-ary tree and an integer K, the task is to print the Kth ancestors of all the nodes of the tree in level order manner. If K ancestors does not exist for a node, then print -1 for that node....
Given a string, recursively remove adjacent duplicate characters from the string. The output string should not have any adjacent duplicates. See the following examples....
Given an undirected weighted graph G consisting of N vertices and M edges, and two arrays Edges[][2] and Weight[] consisting of M edges of the graph and weights of each edge respectively, the task is to find the maximum product of any two vertices of the largest connected component of the graph, formed by connecting all edges with the same weight....
A Geometric series is a series with a constant ratio between successive terms. The first term of the series is denoted by a and the common ratio is denoted by r. The series looks like this:- The task is to find the sum of such a series, mod M....