Microsoft interview question

Easy to mid leetcode question on arrays