C
Time wasted here:
3h
My code feels so clumsy, inelegant, just enough to pass the test cases