mirror of
https://github.com/mudabbir-ahmad/Leet-Code-prog.git
synced 2026-10-08 02:30:21 +00:00
Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
39be980ffe
1 file changed
+14
@@ -0,0 +1,14 @@
|
|||||||
|
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++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in new issue
Block a user