Watch tutorials and explanations by expert teachers that walk through solving this problem.
CyCode
jin's tutorial
Athar Mohd
Programming Live with Larry
Alpha-Code
CodeRapt
Fearless Learner
LeetCode The Hard Way
LetsCode
Solve more problems to master this pattern