Watch tutorials and explanations by expert teachers that walk through solving this problem.
Lit Code
LeetCodeWithMonu
Algorithms Casts
vanAmsen
LeetKey
Kyle McFatter
CodingVilla
SARSA Lab
Solve more problems to master this pattern