Sprout Social Interview Question

The question was a Leetcode - Easy/Medium