nums contains only 0 and 1. Return the length of the longest run of consecutive 1s. If there are no 1s, return 0.
Example 1
Input:
max_consecutive_ones([1, 1, 0, 1, 1, 1])
Output:
3
Example 2
Input:
max_consecutive_ones([0, 0])
Output:
0
0 <= len(nums) <= 3 * 10**50 or 1.No results yet
Run your code to check it against the examples, or submit to run every test.