SpaceX interview question

Detecting patterns in integer arrays