class Solution {
public:
    void moveZeroes(vector<int>& arr) {
        int pos = 0;
        int n = arr.size();
        for(int i =0 ;i < n ; i++){
            if(arr[i]!= 0 ){
                arr[pos++] = arr[i];
            }
        }

        while(pos<n){
            arr[pos++] = 0;
        }
    }
};

https://leetcode.com/problems/move-zeroes/description/

https://takeuforward.org/data-structure/move-all-zeros-to-the-end-of-the-array/