mirror of
https://github.com/mudabbir-ahmad/Leet-Code-prog.git
synced 2026-10-08 02:30:21 +00:00
14 lines
274 B
C++
14 lines
274 B
C++
class Solution {
|
|
public:
|
|
void moveZeroes(vector<int>& nums) {
|
|
int l = 0;
|
|
for (int i = 0; i<nums.size(); i++)
|
|
{
|
|
if(nums[i] !=0)
|
|
{
|
|
swap(nums[l], nums[i]);
|
|
l++;
|
|
}
|
|
}
|
|
}
|
|
}; |