# Category Archives: Searching

Given a string S of length N, the task is to count the number of substrings made up of a single distinct character.Note: For the… Read More
Given an array arr[] of size N, consisting of binary values, the task is to find the longest non-empty subarray consisting only of 1s after… Read More
GUI(Graphical User Interface) helps in better understanding than programs. In this article, we will visualize Binary Search using JavaScript. We will see how the elements… Read More
GUI(Graphical User Interface) helps in better in understanding than programs. In this article, we will visualize Linear Search using JavaScript. We will see how the… Read More
Given an array arr[] consisting of N integers, the task is to find the length of the longest non-decreasing subsequence such that the difference between… Read More
Given an array, arr[] consisting of N integers, the task is to minimize the number of increments of array elements required to make all differences… Read More
Given two integers N and K, the task is to print all the numbers from the range [1, N] whose product of digits is equal… Read More
Given an array arr[] consisting of N positive integers, the task is to find the minimum number of increments required to make the array arr[]… Read More
Given a string S, the task for every index of the string is to find the length of the longest palindromic substring that either starts… Read More
Given an array arr[] consisting of N integers and an integer K, the task is to find the minimum difference between the maximum and minimum… Read More
Given an array arr[] consisting of N integers, and an integer X, the task is to find two elements from the array arr[] having sum… Read More
Given an array arr[] consisting of N distinct integers and an array Q[] representing queries, the task for every query Q[i] is to find the… Read More
Given two strings S1 and S2, the task is to check if S2 contains an anagram of S1 as its substring. Examples:   Input: S1 =… Read More
Given an array arr[] consisting of N pairs [L, R], where L and R denotes the start and end indices of a segment, the task… Read More
Given a binary string S of length N and an integer K, the task is to check if it is possible to flip K 0s… Read More