Amazon Interview Question

Custom hackerrank challenge that's been adjusted to their own use case