Watch tutorials and explanations by expert teachers that walk through solving this problem.
CodeInBits
Road To FAANG
Leet's Code
Think-Twice-Code-Once
Soumya Bhattacharjee
Dev Dive
Mentorpick - by Being Zero
ExpertFunda
Owen Wu
Solve more problems to master this pattern