Bank of America Interview Question

Write a Python function to implement the partition logic of quicksort. The signature of the function is partition(seq: list[int]) → int. Use a fixed pivot which is the number 4. For simplicity, the pivot will always be in the first number in the sequence. The function must partially sort the sequence in-place around the pivot. The function must not create a new list.