Longest subarray contains only 1s | Coding problems