Domanda di colloquio di Ancestry

Coding question- medium difficulty level questions from hacker rank/leet