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