Watch tutorials and explanations by expert teachers that walk through solving this problem.
Code-Yao
Programming Live with Larry
Programming with DPwala
Software Interviews Prep
CyCode
Tim Huang
Solve more problems to master this pattern