Number of Isosceles triangles in a binary tree
Pre-Requisites: Depth First Search | Parent Array Representation Given a parent array representation of a binary tree, we need to find the number of Isosceles… Read More »
Pre-Requisites: Depth First Search | Parent Array Representation Given a parent array representation of a binary tree, we need to find the number of Isosceles… Read More »
Given ‘n’ pair of points, the task is to find four points such that they form a square whose sides are parallel to x and… Read More »
Given an integer ‘sum’ (less than 10^8), the task is to find a pair of prime numbers whose sum is equal to the given ‘sum’… Read More »
Given an array of N numbers, find length of the longest subarray such that K is the second largest element on insertion. Examples: Input: a[]… Read More »
Given three numbers b, x, n. The task is to find the values of ‘a’ in equation (a+b) <= n such that a+b is divisible… Read More »
Given a number N, the task is to print the Kth prime number greater than N. Note: N and K are so given such that… Read More »
Given an array of integers where all the elements are less than 10^6. The task is to find the difference between the largest and the… Read More »
Given a number , find the number of distinct integers obtained by lcm(X, N)/X where X can be any positive number. Examples: Input: N =… Read More »
Given a range [L, R], the task is to find the numbers from the range which have the count of their divisors as even as… Read More »
Given two integers(less than 2^31) A and B. The task is to find the number of bits that are different in their binary representation. Examples:… Read More »
Given an array of integers (less than 10^6), the task is to find the sum of all the prime numbers which appear after every (k-1)… Read More »
Given an infinite chessboard with the same rules as that of chess. Also given are N knights coordinates on the infinite chessboard(-10^9 <= x, y… Read More »
Given an array of size N and X. Find minimum moves required to make the array in increasing order. In each move one can add… Read More »
Given N and K, the task is to print N lines where each line contains 4 numbers such that every among those 4 numbers has… Read More »
Given a number, the task is to check if a number is divisible by 2, 3 and 5 or not. The input number may be… Read More »