Php Program to Find the Longest Bitonic Subsequence
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 a function that takes an array as argument and returns the length of the longest bitonic subsequence. A sequence, sorted in increasing order is considered Bitonic with the decreasing part as empty. Similarly, decreasing order sequence is considered Bitonic with the increasing part as empty. Examples:...
read more
Javascript Program for Longest subsequence of a number having same left and right rotation
Given a numeric string S, the task is to find the maximum length of a subsequence having its left rotation equal to its right rotation....
read more
Maximize count of indices with same element by pairing rows from given Matrices
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 row in the array b[][] such that the total score can be maximized and the score for each pair is calculated as the total indexes at which values of both rows are identical....
read more
Longest subsequence of a number having same left and right rotation
Given a numeric string S, the task is to find the maximum length of a subsequence having its left rotation equal to its right rotation....
read more
Count subsequences having odd Bitwise XOR values from an array
Given an array A[] of size N, the task is to count the number of subsequences from the given array whose Bitwise XOR value is odd....
read more
Minimum number of palindromic subsequences to be removed to empty a binary string
Given a binary string, count minimum number of subsequences to be removed to make it an empty string....
read more
Length of longest substring to be deleted to make a string equal to another string
Given two strings str1 and str2, where str2 is a subsequence of str1, the task is to find the length of the longest substring of str1 which when removed, makes the strings str2 and str1 equal....
read more
Lexicographically smallest K-length subsequence from a given string
Given a string S of length N, the task is to find the lexicographically smallest K-length subsequence from the string S (where K < N)....
read more
Length of longest subsequence consisting of distinct adjacent elements
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 the subsequence are different....
read more
Number of Subsequences with Even and Odd Sum | Set 2
Given an array arr[] of size N. The task is to find the number of subsequences whose sum is even and the number of subsequences whose sum is odd.Examples:...
read more
Minimize sum of smallest elements from K subsequences of length L
Given an array arr[] of size N, the task is to find the minimum possible sum by extracting the smallest element from any K subsequences from arr[] of length L such that each of the subsequences have no shared element. If it is not possible to get the required sum, print -1....
read more
Length of the longest subsequence with negative sum of all prefixes
Given an array arr[] consisting of N integers, the task is to find the length of the longest subsequence such that the prefix sum at each index of the subsequence is negative....
read more