Watch tutorials and explanations by expert teachers that walk through solving this problem.
Naresh Gupta
Algorithms Made Easy
Timothy H Chang
Coding Decoded
Cherry Coding [IIT-G]
Programming Live with Larry
Super Lazy Coder
Joey'sTech
Coders Camp
Solve more problems to master this pattern