public static int findKthLargestSub(int[] nums, int start, int end, int k) {
    int pivot = start;
    int left = start;
    int right = end;
    while (left <= right) {
      while (left <= right && nums[left] <= nums[pivot]) left++;
      while (left <= right && nums[pivot] <= nums[right]) right--;
      if(left < right) {
        swap(nums, left, right);
      }
    }
    
    swap(nums, pivot, right);
    
    if(k == right + 1) {
      return nums[right];
    } else if (k > right + 1) {
      return findKthLargestSub(nums, right + 1, end, k);
    } else {
      return findKthLargestSub(nums, start, right -1, k);
    }
  }