Pregunta de entrevista de IBM

Just standard leetcode problems, easy difficulty.