One Solution is to first sort the array and find the longest subarray with consecutive elements. Time complexity of this solution is O(nLogn).

# Tag - dynamic programming algorithm

One Solution is to first sort the array and find the longest subarray with consecutive elements. Time complexity of this solution is O(nLogn).

Given two positive integers n and k, print all increasing sequences of length k such that the elements in every sequence are from first n natural numbers.

Given two strings str1 and str2, find if str1 is a subsequence of str2. A subsequence is a sequence that can be derived from another sequence by deleting

Given two strings str1 and str2, find if str1 is a subsequence of str2. A subsequence is a sequence that can be derived from another sequence by deleting

Given two strings str1 and str2, find if str1 is a subsequence of str2. A subsequence is a sequence that can be derived from another sequence by deleting

Given an array of random numbers, find longest monotonically increasing subsequence (LIS) in the array.If you want to understand the O(NlogN) approach.

C++ Programming number of contiguous subsequences - Mathematical Algorithms - Given a number as a string, write a function to find the number of substrings

C Programming - Count ways to reach the n stair - Mathematical Algorithms - There are n stairs, a person standing at the bottom wants to reach the top.

C++ Programming - Count number of binary strings without consecutive 1’s - Mathematical Algorithms - Let a[i] be the number of binary strings of length