Pregunta de entrevista de Paycom

two medium level leetcode question