FlyerTalk Forums - View Single Post - The Forum Lounge Thread (2022)
View Single Post
Old Dec 6, 2022, 8:52 am
  #991  
canopus27
 
Join Date: Dec 2011
Location: YYZ
Programs: AC SEMM / HH Diamond
Posts: 3,178
Originally Posted by RangerNS
Day 6.

Interesting how the mind works.

Conceptualized the solution in 10 minutes, another 20 to implement. And then off by 1 (..4) errors. Finally broke down and checked the subreddit, and everyone was celebrating their 4 minute solutions. I'll admit to glancing at a solution (in a different language). Dammit. It is something of a trivia game.. I remembered pop() and push() (actually, append()), but perhaps remembering shift() would have gotten me down a path to thinking that uniq() worked.

48 minutes.
Pretty pleased today ... less than 10 minutes, with part 2 taking just a handful of seconds.

I actually didn't use a queue or shift/rotate function ... I used a different approach entirely. This is my key function:

Spoiler
 

Last edited by canopus27; Dec 6, 2022 at 8:57 am Reason: Added code
canopus27 is online now