Motorola Solutions interview question

Leetcode array question, i would say study neetcode 150