KLA Interview Question

Arrays and Dictionary related DS problem