Amazon Interview Question

Coding challenge with two scenarios mainly focused around data structures and algorithms