Google interview question

Subarray contiguous count occurrence and return