Pergunta de entrevista da empresa National General Insurance

A leetcode problem, easy difficulty.