Watch tutorials and explanations by expert teachers that walk through solving this problem.
Leet's Code
CodeVia
Leetcode Solutions
Developer Coder
Luc Taylor
Saone.777
LetsCode
Solve more problems to master this pattern