Question d’entretien chez Google

Coding question solved with math and sliding window.