TUQ Interview Question

To solve a leetcode question