Amazon Interview Question

Maximum overlap Problem