Adobe Interview Question

Resolve a leetcode problem on HackerRank