text: from typing import List
  
  
  class Solution:
      def sortColors(self, nums: List[int]) -> None:
          """
          Do not return anything, modify nums in-place instead.
          """
          l, m, r = -1, 0, len(nums)
          while m < r:
              if nums[m] == 0:
                  l += 1
                  nums[m], nums[l] = nums[l], nums[m]
              elif nums[m] == 2:
                  r -= 1
                  nums[m], nums[r] = nums[r], nums[m]
              m += 1