Amazon Interview Question

It wasn’t leetcode style question