Watch tutorials and explanations by expert teachers that walk through solving this problem.
NeetCodeIO
Everyday Data Science
Code with Carter
Data Science University - MLV Prasad
Sleepy Cracker
Solve more problems to master this pattern