Question:Given an array of positive integers. Find the length of the longest sub-sequence such that elements in the subsequence are consecutive integers, the consecutive numbers can be in any order.
Attempt link:https://ide.geeksforgeeks.org/DXwAWbd0SV
I have added a comment on a for loop saying TIME COMPXITY OF THIS LOOP???.
Please explain how is the time complexity of this loop O(n)?