FDM Group Interview Question

Q: Leetcode style question (easy leetcode)