Pinterest Interview Question

technical questions in the first technical round were medium LC difficulty