Given an array nums, write a function to move all 0’s to the end of it while maintaining the relative order of the non-zero elements.
class Solution {
public void moveZeroes(int[] nums) {
if(nums==null||nums.length==0){
return;
}
int lo=0;
int i=0;
while(i<=hi){
if(nums[i]!=0){
int temp=nums[i];
nums[i]=nums[lo];
nums[lo]=temp;
lo++;
}
i++;
}
}
}