Amazon interview question

Maximum overlap Problem