def partition(array: list[int], left: int, right: int) -> int:
    """
        # Partition
        Handles the sorting aspect of `quick_sort`, plays a `part` (good one i know) in the divide & conquer aspect of this algorithm.
        ### Parameters:
        ```py
        array: list[int] # Array to partition.
        left: int # Left most position of where you want to partition.
        right: int # Right most position of where you want to partition.
        ```
    """
    pivot: int = array[right]
    i: int = left - 1
    for j in range(left, right):
        if array[j] < pivot:
            i += 1
            array[i], array[j] = array[j], array[i]
    array[i + 1], array[right] = array[right], array[i + 1]
    return i + 1