Watch tutorials and explanations by expert teachers that walk through solving this problem.
stoney codes
NeetCode
Coding Interview Prep
Eugene Suleimanov
TheAnalyticGuy
EverydayLeetcode
Solve more problems to master this pattern