Google Interview Question

I was asked to solve questions roughly leetcode-medium in difficultly.