Find the length of the subarray with longest consecutive 1s in a binary array.
Asked in the Tech 1 stage.
Implement a function that takes a binary array nums and returns the maximum length of any contiguous subarray made up only of 1s.
nums: a list of integers containing only 0 and 11s.def longest_consecutive_ones(nums):