Applied Intuition Interview Question

one of the coding questions was a tagged leetcode problems