➜ ~

Playing Hacks and Stuffs!


Project maintained by h4ckyou Hosted on GitHub Pages — Theme by mattgraham

Find Smallest Letter Greater Than Target

image image

I initially tried implementing binary search algorithm but I got to a test case where it wasn’t just working and i spent so many hours trying to fix it but didn’t succeed :(

So I moved to solving it using Linear Search image

It works but the time and space complexity is low also you can see I was trying to solve it 2 hours ago but the last test case was not working 🥲

Solve Script: link

After checking the solution other people made I figured my mistake in my previous Binary Search program and I was totally over complicating it lool

Anyways here’s a more efficient script: link omoo