The main problem of the question is TLE i.e. time limit exceeded error, so to overcome the problem we design a more reliable and fast algorithm, which is explained in the video.
Link to the question:
https://www.hackerrank.com/challenges...
Please tell me in the comment section if you want me to solve any other problems (any platform). I'll be more than happy to solve them!
Watch video Sherlock and squares | Hackerrank | Problem Solving | Easy | Java online without registration, duration hours minute second in high quality. This video was added by user AlgorithmHQ 06 May 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 2,125 once and liked it 57 people.