Pergunta de entrevista da empresa IBM

basic leetcode question you can see in easy/medium