Given an array arr, the task is to find the maximum sum of subsequence after flipping signs of at most K elements. Examples: Input: arr… Read More

# Tag Archives: subsequence

Given an array arr[] of N integers, the task is to find the number of subsequences of the given array such that their Bitwise AND… Read More

Given a string S of size N consisting of digits [1, 9], the task is to find the length of the smallest subsequence in the… Read More

Given an integer K and an array arr[] having N pairwise distinct integers in the range [1, K], the task is to find the lexicographically… Read More

Given a string S consisting of N digits, the task is to partition the string into at most two increasing subsequences such that concatenation of… Read More

Given a string S, the task is to find the lexicographically largest subsequence that can be formed using all distinct characters only once from the… Read More

Given a string S consisting of N characters, the task is to find the minimum number of characters that must be added to S such… Read More

Count subsequence of length 4 having product of the first three elements equal to the fourth element

Given an array arr[] consisting of N positive integers, the task is to find the number of subsequences of length 4 having product of the… Read More

Minimize steps to form string S from any random string of length K using a fixed length subsequences

Given a string S consisting of N characters and a positive integer K, the task is to find the minimum number of operations required to… Read More

Given a string str containing characters ‘G’ and ‘F’ only, the task is to check if the given string str can be made empty after… Read More

Given an array arr[] consisting of N integers, the task is to find the maximum value of K such that for every integer i over… Read More

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

Given an array arr[] consisting of N positive integers, the task is to check if the product of elements of every subsequence of the given… Read More

Given a string S consisting of N lowercase English alphabets, and an integer K and, an array cost[] of size 26 denoting the cost of… Read More

Given an array arr[] consisting of N positive integers, the task is to find all the possible distinct Greatest Common Divisors(GCDs) among all the non-empty… Read More