Link of the question is here
Hello fellow coders,
I am facing a problem in 500-B problem. All the required links are given and the problem with my solution is that I am getting TLE. I am really unable to find what is wrong with my solution. If anybody could help me out then please help me.
I am sorry if anyone get annoyed thinking that I am asking a very easy question. I really need help as I am coding without any coach. Please help me out.
Thanks in advance