FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
LeetCode-NOTES/Algorithms/27.Remove-Element/solution.cpp at master · moranzcw/LeetCode-NOTES · GitHub
moranzcw
/
LeetCode-NOTES
Public
Notifications
You must be signed in to change notification settings
Fork
77
Star
201
Code
Issues
1
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
LeetCode-NOTES
/
Algorithms
/
27.Remove-Element
/
solution.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
18 lines (18 loc) · 343 Bytes
Breadcrumbs
LeetCode-NOTES
/
Algorithms
/
27.Remove-Element
/
solution.cpp
Copy path
File metadata and controls
18 lines (18 loc) · 343 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
class
Solution
{
public:
int
removeElement
(vector<
int
>& nums,
int
val)
{
int
length =
0
;
for
(
int
i=
0
,j=
0
;j<nums.
size
();j++)
{
if
(nums[j] != val)
{
nums[i] = nums[j];
i++;
length ++;
}
}
return
length;
}
};
Back
|
FazBrowse Home
|
New Git URL