Given a string S of size N consisting of ‘0’, ‘1’ and ‘?’, where N is always even. Divide the string into two different strings… Read More

# Tag Archives: subsequence

Given a binary string S of length N. The task is to find the following: The minimum number of subsequences, string S can be divided… Read More

Given an array arr[] consisting of N positive integers, the task is to find the maximum value of the difference between the sum of elements… Read More

Given an array arr[0 … n-1] containing n positive integers, a subsequence of arr[] is called Bitonic if it is first increasing, then decreasing. Write… Read More

Given an array vec[] of size N of non-negative integers. The task is to count the number of subsequences with the sum equal to S… Read More

Given an array arr[] of size N and an integer X, the task is to find the length of the longest subsequence such that the… Read More

Given an array arr[] of N integers and an integer D, the task is to find the length of the longest non-decreasing subsequence such that… Read More

Given two 2D binary arrays, a[][] and b[][] both of size M*N, the task is to pair each row in the array a[][] with any… Read More

Given an array arr[] of N positive integers, the task is to find the minimum cost to sort the given array by moving an array… Read More

Given an array arr[] of N integers and a positive integer K, the task is to check if it is possible to divide the array… Read More

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