Egnyte interview question

2 questions on arrays. It was leetcode medium level