After watching this video, you will absolutely understand everything regarding this question!
Video Contents:
00:00 - Read and understand the question
01:50 - Explain the approach/intuition
05:44 - Notes on brute force approach
06:30 - Explain the optimization
11:56 - Code the optimization