Skip to content

Tag Archives: subsequence

Given an array arr[] of size N, the task is to find the minimum number of array elements required to be removed from the array… Read More
Given a string str of length N, the task is to print all possible non-empty subsequences of the given string such that the subsequences either… Read More
Given an array arr[] consisting of N integers and two integer values L and R, indicating the starting and ending indices of a subarray, the… Read More
Given two positive integers N and K, the task is to print all possible K-length subsequences from first N natural numbers whose sum of elements… Read More
Given an array arr[] consisting of N integers and an array Queries[][] with each query of the form {x, y}. For each query, the task… Read More
Given an array arr[] of size N, the task is to find the longest non-empty subsequence from the given array whose sum is maximum. Examples:… Read More
Given a string str of length N, the task is to print all possible distinct subsequences of the string str which consists of non-repeating characters… Read More
Given an array arr[] consisting of N unique elements, the task is to generate an array B[] of length N such that B[i] is the… Read More
Given a binary string, str, the task is to empty the given string by minimum number of removals of a single character or a subsequence… Read More
Given a string str, consisting of lowercase alphabets, the task is to find the shortest string which is not a subsequence of the given string.… Read More
Given two arrays arr1[] and arr2[] of length M and N consisting of digits [0, 9] representing two numbers and an integer K(K ≤ M… Read More
Given an array arr[] of size N, the task is to count the number of longest increasing subsequences present in the given array. Examples: Input:… Read More
Given an array arr[] of length N, the task is to find the Bitwise OR of the sum of all possible subsequences from the given… Read More
Given an array arr[], the task is to find the length of the longest subsequence of the array arr[] such that all adjacent elements in… Read More
C++ // C++ program of the // above approach   #include <cstring> #include <iostream>   using namespace std; const int maxN = 2002;   //… Read More

Start Your Coding Journey Now!