@GregHogg

Thank you for watching the video! This was shortened to fit in the shorts feed, please click the related video link to see the whole thing (trust me it's worth it!)

@akhilhandoo3303

I think your solution takes O(n log n) time due to the sort(). The requirement in question clearly mentions constraint of O(n) time.

@sachinkun21

Hey here’s o(n), go through list and put everything into Set. 
Finally go through list again with as curnum and check if previous number i.e curnum - 1 exists in set or not. If it exists then continue to next number i.e curnum+1 as curnum else if it prevnum doesn’t exist that marks as start of a new sequence.  
Use another loop let’s call it sequence length counting loop inside to check till what point curnum+1 exists in set. This way, for example given in video the sequence counting loop will execute only for 100, 200, and 1 where total number of iterations will still be 6 i.e total elements count.

@hlubradio2318

Wait a sec.  I thought we have to find the sequence in the list without sorting it first

@GregHogg

Follow me on LinkedIn, I accept every connection!

@Stepbrohelp

As someone who has just started getting into programming, your videos are super great! I specifically like these noob vs pro programmer ones, because it shows the way I think (noob) and also how I can improve my thought process to write more efficient code (pro). I don’t think I’d be able to get that “pro” perspective otherwise, so thanks!

@at-sushi

I needed a couple of weeks to understand LCS.

@SathvikSagar

Every time i see i realise i code like a noob programmer 😭😭

@vaxokoko

It’s good for new programmers to learn the basics, but it is hardly use in real life

@ravitejaw4604

This was one those problems, i thoroughly enjoyed solving it.

@guilhermewxs1840

Bruh i'd just throw a hashmap on it 😂😂

@hlubradio2318

Damn dude you make every so simple.  I gotta take the time to implement some of these

@rushikesh1009

Cycle sort will give ans in n complexity easily

@Saheryk

I wondered how were you able to solve it in 3 seconds.

@dbarless

Interview questions like this are stupid, never in my 8 years programming professionally have I ever run into any problem like this leetcode style nonsense

@Dri143

what us the site of the challenges? leetcode?

@Ryan-Pot

Not the animated mouth movement 😭

@patarasila

Solved it in O(n) in abt 2 mins

@jjhassy

just did the noob one last night :(

@MdEhteshamBCH

I can't find the link to the solution