You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You're given an array of integers and an integer. Write a function that moves all instances of that integer in the array to the end of the array and returns the array.
The function should perform this in place, i.e don't create a new array.
You don't need to maintain the order of integers.
for example
array = [2, 1, 2, 2, 2, 3, 4, 2]
to move = 2
output = [1, 3, 4, 2, 2, 2, 2, 2] // the number 1, 3 and 4 could be ordered in any way.