Pergunta de entrevista da empresa Flexible Finance

Leetcode medium question + follow-up