Amazon interview question

1. Array and hashmap Question 2. String question