Pergunta de entrevista da empresa Appian

Leetcode Easy to Medium problem and asked to write testcases to fill up the time.