Google Interview Question

data structure algorithm medium difficulty question