You are given an array of integers and a target integer. Write a function that moves all instances of the target integer in the array to the end of the array. The order of the non-target integers in the array should be maintained.
Example
- Input: ([2, 1, 2, 2, 2, 3, 4, 2], 2)
- Output: [1, 3, 4, 2, 2, 2, 2, 2]