Count of distinct colors in a subtree of a Colored Tree with given min frequency for Q queries
Given a N-ary tree with some colour associated with every node and Q queries. Each query contains two integers A and X. The task is… Read More »
Given a N-ary tree with some colour associated with every node and Q queries. Each query contains two integers A and X. The task is… Read More »
Given N * M rectangular park having N rows and M columns, each cell of the park is a square of unit area and boundaries… Read More »
Given an array arr[] consisting of N non-negative elements and an integer X, the task is to make X increments such that the value of… Read More »
Given a string s containing letters ‘a’, ‘b’ and ‘c’, the task is to calculate all possible triplets made up of the three characters, and… Read More »
Given an array arr[] consisting of integers, the task is to split the given array into two sub-arrays such that difference between their maximum elements… Read More »
Pre-requisite: Travelling Salesman Problem, NP Hard Given a set of cities and the distance between each pair of cities, the travelling salesman problem finds the… Read More »
Given two 2-D arrays which represent intervals. Each 2-D array represents a list of intervals. Each list of intervals is disjoint and sorted in increasing… Read More »
Given a string str of length N, consisting of ‘(‘ and ‘)‘ only, the task is to check whether it is balanced or not. Examples:… Read More »
Given a Binary Search Tree and a binary integer K, the task is to convert Binary search tree into a Skewed Tree in increasing order… Read More »
Given a string str and an integer K, the task is to find the K-th most frequent character in the string. If there are multiple… Read More »
Given an array arr[] of size N, the task is to find the minimum LCM (Least Common Multiple) of all unique pairs in the given… Read More »
Given an array arr[], the task is to find the maximum sum of all the elements which are not a part of the longest increasing… Read More »
Given an integer N, the task is to count the number of ways to arrange triplets (a, b, c) within [1, N] in such a… Read More »
Given an array A[] of length N, the task is to find lexicographically smallest array by swapping adjacent elements for each index atmost once. Thus,… Read More »
Given an undirected graph G, the task is to find the shortest path of even-length, given 1 as Source Node and N as Destination Node.… Read More »