Amazon Interview Question

1. Array and hashmap Question 2. String question