move-zeroes 1.0.0
Move Zeroes
Loading...
Searching...
No Matches
Solution Class Reference

Public Member Functions

void moveZeroes (vector< int > &nums)
 

Detailed Description

Definition at line 5 of file main.cpp.

Member Function Documentation

◆ moveZeroes()

void Solution::moveZeroes ( vector< int > &  nums)
inline

Definition at line 8 of file main.cpp.

9 {
10 int index = 0;
11 for (int el: nums)
12 if (el != 0)
13 nums[index++] = el;
14 while (index < (int)nums.size())
15 nums[index++] = 0;
16 }

Referenced by main().


The documentation for this class was generated from the following file: