Skip to content

# Tag Archives: two-pointer-algorithm

Given an array arr[] of length N with unique elements, the task is to find the length of the longest increasing subsequence that can be… 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 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 an integer array arr[] and an integer K, the task is to find the number of non-empty subsets S such that min(S) + max(S)… Read More
Given string str consisting of only lowercase English alphabets, the task is to find the substring of the smallest length which contains all the vowels.… Read More
We generally study most of the algorithmic techniques in academics like Searching, Sorting, Dynamic Programming, Greedy Algorithms, Divide and Conquer, Backtracking, etc. But below techniques… Read More
Given the integers a, b, N, the task is to find the largest number x such that is an N-digit number of base b. Examples:   Input:… Read More
Given an array of size N containing all elements as 0 initially, and a Q queries containing range in the form of [L, R]. The… Read More
Given an array arr[] of N elements, the task is to find the length of the smallest subarray such that when this subarray is removed… Read More
Set 1: Sliding Window Maximum (Maximum of all subarrays of size k).Given an array arr of size N and an integer K, the task is… Read More
Given an array arr of integers of size N and a target number, the task is to find all unique quadruplets in it, whose sum… Read More
Given a sorted array arr of size N, the task is to reduce the array such that each element can appear at most two times.… Read More
Given an integer K and a binary string S of length N, the task is to find out the number of substrings whose decimal equivalent… Read More
There are two singly linked lists in a system. By some programming error, the end node of one of the linked lists got linked to… Read More
Given an array arr[] with N distinct numbers and another array arr1[] with N-1 operators (either < or >), the task is to organize the… Read More