Watch tutorials and explanations by expert teachers that walk through solving this problem.
Sahil & Sarra
NeetCodeIO
Algorithms Made Easy
John Leonardo
Programming Live with Larry
Tech with M
code io - English
David Anuson
Solve more problems to master this pattern