Pergunta de entrevista da empresa Grid Dynamics

it was leetcode mid problems