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 sequence
2 Articles
2
One Solution is to first sort the array and find the longest subarray with consecutive elements. Time complexity of this solution is O(nLogn).