Given an array a[] of positive integers. Subtract any positive integer from any number of elements of the array such that there exists every possible… Read More

# Tag Archives: subsequence

Given an array arr[] containing integers. The task is to find the largest subsequence such that at any point in time prefix sum of that… Read More

Given a string S of size N and a linked list, the task is to check if the linked list contains a string as a… Read More

Given an array arr[] of size N, and integer K. The task is to find the longest subsequence with the difference between adjacent elements as… Read More

Given a string of lowercase characters S, the task is to find longest subsequence of the string with no 3 consecutive identical characters.Examples: Input: S… Read More

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

Given an array sequence arr[] i.e [A1, A2 …An] and an integer k, the task is to find the maximum possible sum of increasing subsequence… Read More

Given an array arr of size N, and two integers A and B. The task is to find the length of the longest subsequence with… Read More

Given an array arr[] of size N containing positive integers, the task is to find the maximum number of elements that can be deleted from… Read More

Given an array arr[] of N integers and an integer K, the task is to find the maximum count of distinct elements over all the… Read More

Given an array of integers arr[], find the subsequence with maximum sum whose elements are first decreasing, then increasing, or vice versa, The subsequence can… Read More

Given an array arr[] of size N. The task is to find the maximum score that can be achieved by alternative minus – plus of… Read More

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