Okta interview question

They gave me a LeetCode Medium question