Okta Interview Question

I was asked to solve a LeetCode medium question live.