# Category Archives: Searching

Given two positive integers L and R, the task is to find the count of ordered pairs in the range [L, R] such that the… Read More
Given a Binary Tree consisting of 0s and 1s only, the task is to print the count of levels in the Binary Tree in which… Read More
Given a string str and an array cost[] of size N where cost[i] denotes the cost to remove the ith character from the string str,… Read More
Given a mountain array arr[] and an integer X, the task is to find the smallest index of X in the given array. If no… Read More
Given an array arr[] of size N, the task is for each array element is to find the nearest non-equal value present on its left… Read More
Given an array arr[] consisting of N positive integers, the task is to find the sum of factors of product of all array elements. Since… Read More
Given an array arr[] of size N, the task is to find the minimum count of array elements found by applying the Randomized Binary Search… Read More
Given a character array, str[] of consisting of N lowercase alphabets, and an integer array, arr[] consisting of numbers in the range [0, N –… Read More
Given two integers L and R, the task is to find the count of numbers in the range [L, R] whose first and last digit… Read More
Given an array, arr[] size N, the task is to find the smallest index of the array such that the sum of all the array… Read More
Given an array arr[] of size N, where arr[i] is the time required to visit ith city, the task is to find the minimum total… Read More
Given two positive integers N and X, the task is to find the smallest divisor of N which is closest to X. Examples: Input: N… Read More
Given an array, arr[] of size N, the task is to find the distinct absolute differences of all possible pairs of the given array. Examples:… Read More
Given two arrays firstArr[], consisting of distinct elements only, and secondArr[], the task is to find the length of LCS between these 2 arrays. Examples:… Read More
Given a binary string str, the task is to find the count of ways to partition the string such that each partitioned substring contains exactly… Read More