Watch tutorials and explanations by expert teachers that walk through solving this problem.
Mark Rober
TED-Ed
Simply Logical
Gaurav Sen
Aditya Verma
GeeksforGeeks
Back To Back SWE
Pepcoding
Hua Hua
Solve more problems to master this pattern