numsPos), where the index represents the value in the original array and the value at that index is the position of that number in the original array.inPosition that takes numsPos and a start parameter to determine the sorting strategy (0 for empty space at the end, 1 for empty space at the beginning).inPosition, iterate through numsPos and swap the zero with the first number that is not in the correct position.inPosition twice with different start values and return the minimum of the two results.