Watch tutorials and explanations by expert teachers that walk through solving this problem.
NeetCode
Bradley Allen
Everyday Data Science
Everyday Data Science
Frederik Müller
Baozi Training
Everyday Data Science
Efficient Algos
Data Science University - MLV Prasad