Backstory: I got this during one of my interviews and I messed it up lol

I know there are many libraries but doing it manually can improve your logic

img1

Current index: 0