Watch tutorials and explanations by expert teachers that walk through solving this problem.
Algorithms Made Easy
ExtremeProgrammer
vanAmsen
HowToLeetCode
LeetCoder
Just Coding, with Jie
robzingcod
Solve more problems to master this pattern