code: def longestOnes(self, nums: List[int], k: int) -> int:
      left = 0
      count = {}
  
      for right in range(len(nums)):
          k -= 1 - nums[right]
          if k < 0:
              k += 1 - nums[left]
              left += 1
  
      return right - left + 1
  
label_desc: Use image node_id 1 for calling the Solution obj's underlying member method code with example usage: obj.longestOnes(nums, k) and returns: unknown