Pregunta de entrevista de Bloomberg

2 leetcode medium problems and come up with their analyses.