Domanda di colloquio di IBM

two LC easy/medium-difficulty questions for hackerrank