## Sum of width (max and min diff) of all Subsequences

Given an array A[] of integers. The task is to return the sum of the width of all subsequences of A. For any sequence S,… Read More »

- Longest Common Subsequence | DP-4
- Longest Palindromic Subsequence | DP-12
- Longest Increasing Subsequence Size (N log N)
- Longest Consecutive Subsequence
- Printing Longest Common Subsequence
- Print all subsequences of a string
- Subarray/Substring vs Subsequence and Programs to Generate them
- Count Distinct Subsequences
- Longest Bitonic Subsequence | DP-15
- Shortest Common Supersequence
- Given two strings, find if first string is a subsequence of second
- Find all distinct subset (or subsequence) sums of an array
- Number of subsequences of the form a^i b^j c^k
- Longest Repeating Subsequence
- Find a sorted subsequence of size 3 in linear time
- Variations of LIS | DP-21
- Count all subsequences having product less than K
- Construction of Longest Increasing Subsequence using Dynamic Programming
- Count All Palindromic Subsequence in a given String
- Find number of times a string occurs as a subsequence in given string
- A Space Optimized Solution of LCS
- Count distinct occurrences as a subsequence
- Longest palindrome subsequence with O(n) space
- Find largest word in dictionary by deleting some characters of given string
- Number of subsequences in a string divisible by n
- Longest Common Increasing Subsequence (LCS + LIS)
- Longest Zig-Zag Subsequence
- Repeated subsequence of length 2 or more
- Maximum sum Bi-tonic Sub-sequence
- Print all longest common sub-sequences in lexicographical order

Given an array A[] of integers. The task is to return the sum of the width of all subsequences of A. For any sequence S,… Read More »

Given a string of lowercase English alphabets. The task is to check if there exists any subsequence in the string which is not a palindrome.… Read More »

Given an array. The task is to find the length of the longest subsequence in which all elements must have at least one digit in… Read More »

Given an array of size N and a sum, the task is to check whether some array elements can be added to sum to N… Read More »

Given a bracket sequence of even length. The task is to find how many ways are there to make balanced bracket subsequences from the given… Read More »

Given two string S and Q. The task is to count the number of the common subsequence in S and T. Examples: Input : S… Read More »

Given an array. The task is to generate and print all of the possible subsequences of the given array using recursion. Examples: Input : [1,… Read More »

Given two strings X and Y of length m and n respectively. The problem is to find the length of the longest common subsequence of… Read More »

Given a number N. The task is to find the number of permutations of 1 to N such that no three terms of the permutation… Read More »

Given a string containing only two characters i.e. R and K (like RRKRRKKKKK). The task is to find the maximum value of N for a… Read More »

Given an array of N positive integers and Q queries consisting of an integer K, the task is to print the length of the longest… Read More »

Given an array of N positive integers write an efficient function to find the sum of all those integers which can be expressed as the… Read More »

Given a string, the task is to check if there exist two equal sub-sequences in the given string. Two sub-sequences are said to be equal… Read More »

Given an array of integers, find number of subsequence such that the sum of the subsequence is divisible by m. It is given that sum… Read More »

Given a non-empty string S containing only lowercase letters, print all ‘Special Subsequences’ of S. For Instance, “ab” has the following Special Subsequences-: { “A”,… Read More »