Amazon interview question

Array and Hashing type LC Question