input: from typing import List
  
  def max_consecutive_subset(nums: List[int]) -> int:
      """
      You have a 0-indexed list of positive integers, nums.
  
      Initially, any element in the array can be incremented by at most 1.
  
      After this, you need to choose one or more elements such that, when sorted in ascending order, they form a consecutive sequence. For example, [3, 4, 5] are consecutive but [3, 4, 6] and [1, 1, 2, 3] are not.
  
      Return the maximum number of such consecutive elements you can select.
  
      Examples:
      >>> nums = [2,1,5,1,1]
      3
      >>> nums = [1,4,7,10]
      1
  
      Constraints:
      1 <= nums.length <= 10^5
      1 <= nums[i] <= 10^6
      """
output:     nums.sort()
      max_length = 0
      current_length = 1
      
      for i in range(1, len(nums)):
          if nums[i] == nums[i - 1]:
              continue
          elif nums[i] == nums[i - 1] + 1 or nums[i] == nums[i - 1] + 2:
              current_length += 1
          else:
              max_length = max(max_length, current_length)
              current_length = 1
              
      max_length = max(max_length, current_length)
      
      return max_length