Microsoft Interview Question

I was asked the most common two pointers/hashmap question. 2 maths related questions