Watch tutorials and explanations by expert teachers that walk through solving this problem.
NeetCode
Nick White
Hua Hua
Kumar Sanjeev
Code Nop
Programming Live with Larry
CodeSpace
Satyam Kumar
Solve more problems to master this pattern