function sortColors(nums) {
  // end::description[]
  // tag::placeholder[]
  // write your code here...
  // end::placeholder[]
  // tag::solution[]
  let left = 0;
  let right = nums.length - 1;
  let curr = 0;

  while (curr <= right) {
    if (nums[curr] < 1) {
      [nums[curr], nums[left]] = [nums[left], nums[curr]]; // swap
      left++;
      curr++;
    } else if (nums[curr] > 1) {
      [nums[curr], nums[right]] = [nums[right], nums[curr]]; // swap
      right--;
    } else {
      curr++;
    }
  }
  // end::solution[]
  // tag::description[]
}
Sort array of 0's, 1's and 2's in linear time and in-place.
@param {numbers[]} nums - Array of number (0, 1, or 2).
@returns {void} Don't return anything, modify the input array.