Identifying array elements, rearranging them, and replacing them
It's extraordinarily confusing to have if (fast == nums.length - 1) as a conditional within a loop that continues while fast &lt; nums.count returns true.  This is the last part of the loop, and it only executes on the last iteration of the loop... so why is it even in the loop at all?

A couple of comments in our code can help us out.  We have two distinct parts:


Shuffling the non-tens to the front.
Zero-ing out the tens.


So let's use comments to mark these in distinct blocks.  And, let's move the second part to its own loop.

And while we're at it, let's make the method more generic to replace any number with another given number.

public int[] replaceNum(int[] nums, int eliminationNum, int replaceNum) {
    int nextMoveIndex = 0;

    // shuffle non-elims to the front
    for (int i = 0; i &lt; nums.length; ++i) {
        if (nums[i] != eliminationNum) {
            nums[nextMoveIndex++] = nums[i];
        }
    }

    // zero out the elimination number
    while (nextMoveIndex &lt; nums.length) {
        nums[nextMoveIndex++] = replaceNum;
    }

    return nums;
}