Pregunta de entrevista de SAP

A small coding round from leetcode question