Hi, I was wondering whether anyone could help me with TLE. The problem link is pasted and my solution is attached(photo)
My solution is only 18 lines while the other successful solutions are 30+. I ran my program through multiple testcases and the answers are all correct. Thank you so much.