class Solution { /** * T(N) = O(2N) * Create a temp arraylist to store non-zeros elements * Run a loop over tempArray list and start storing non-zero element back to original array from index=0 * At last we will run loop again until index < array.length, because we have to store zeroes at last of array */ public void moveZeroes(int[] nums) { ArrayList tempList = new ArrayList<>(); for(int i=0;i