Pregunta de entrevista de IBM

two LC easy/medium-difficulty questions for hackerrank