Your question is Move All Occurrences of X. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
AppFolio may need to reorder a property-related array so records with a particular marker value are processed last. Given an integer array nums and an integer x, move every occurrence of x to the end of the array in place, while preserving the relative order of all other values and the relative order of the moved x values.
This is a stable partition, not a cyclic rotation. Return the modified array.
Implement move_value_to_end(nums, x), where nums is a mutable list of integers and x is an integer. Modify nums directly and return the same list object. The output must contain exactly the same values as the input, with all values not equal to x first, followed by all values equal to x.
def move_value_to_end(nums, x):