Given a Binary Tree and an integer target, denoting the value of a node, the task is to find the sum of distances of all… Read More

# Category Archives: Searching

Given a binary tree consisting of N nodes, the task is to find the sum of depths of all subtree nodes in a given binary… Read More

Given a string S of length N which is the English representation of any number of digits in the range [0 – 9] in jumbled… Read More

Given two binary arrays L1[] and L2[], each of size N, the task is to minimize the count of remaining array elements after performing the… Read More

Given an array arr[] of size N and a 2D array Q[][] consisting of queries of following two types: 1 X Y: Update the array… Read More

Given an integer N which denotes the number of slots, and an array arr[] consisting of K integers in the range [1, N] repreand. Each… Read More

Given an integer D, the task is to find the count of all possible positive integers N such that reverse(N) = N + D. Examples:… Read More

Given two binary strings S1 and S2 of length N (1 ≤ N ≤ 105), the task is to check if it is possible to… Read More

Given a 2D array A[][2] of size N (1 ≤ N ≤ 103), where A[i][0] and A[i][1] denotes the length and breadth of rectangle i… Read More

Given an array A[] of size N(1 ≤ N ≤ 105), consistingof positive integers, where the score of an index i in range [0, N… Read More

Given a string S and a string T, the task is to find the minimum possible length to which the string S can be reduced… Read More

Given a sorted array arr[] of size N (1 ≤ N ≤ 105) and two integers A and B, the task is to calculate the… Read More

Given two binary strings str1 and str2 having same length, the task is to find if it is possible to make the two binary strings… Read More

Given two arrays arr1[] and arr2[] of size N and M respectively, the task is to count the minimum number of swapps required between the… Read More

Given an array arr[] consisting of N positive integers and a positive integer K, the task is to find the count of array elements whose… Read More