Watch tutorials and explanations by expert teachers that walk through solving this problem.
NeetCodeIO
Endeavour Monk
coder4life
Hanu
AnshulOnTech
Scott Hacks Code
Alpha-Code
Solve more problems to master this pattern