Watch tutorials and explanations by expert teachers that walk through solving this problem.
Code-Yao
Algorithms Casts
Lester Dela Cruz
Sleepy Cracker
Lulu Code
The algorithm Architect
[CE] Code Engineering
Solve more problems to master this pattern