Implement `longestOnes(nums, k)` returning the length of the longest subarray of 1s after flipping at most `k` zeros to 1.
Run your code to see results.