Google Interview Question

Subarray contiguous count occurrence and return