Aquant Interview Question

Leetcode question - easy/medium (arrays, hashmap)