Microsoft Interview Question

Basic data structure and O(n)