Watch tutorials and explanations by expert teachers that walk through solving this problem.
Algorithms Casts
Programming Live with Larry
Ethos Typos
Alpha-Code
Elite Code
Think-Twice-Code-Once
Compl3x
ELeetCoder
Kyle McFatter
Solve more problems to master this pattern