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