Box Interview Question

Coding question based on data structures. Needed to be in a specific complexity range.