Google Interview Question

Both question is a variant of leet code problem.