One Solution is to first sort the array and find the longest subarray with consecutive elements. Time complexity of this solution is O(nLogn).
longest common subsequence algorithm
3 Articles
3
One Solution is to first sort the array and find the longest subarray with consecutive elements. Time complexity of this solution is O(nLogn).
C program to check subsequence – C Programming – User will input two strings and we find if one of the strings is a subsequence of other.