FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
leetcode/removeelement.java at master · wpande/leetcode · GitHub
wpande
leetcode
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
leetcode
/
removeelement.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
12 lines (12 loc) · 297 Bytes
Breadcrumbs
leetcode
/
removeelement.java
Copy path
File metadata and controls
12 lines (12 loc) · 297 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
public
class
Solution
{
public
int
removeElement
(
int
[]
nums
,
int
val
) {
int
len
=
nums
.
length
;
if
(
len
==
0
)
return
len
;
for
(
int
i
=
0
;
i
<
len
&&
len
!=
0
;
i
++)
if
(
nums
[
i
]==
val
){
nums
[
i
--]=
nums
[--
len
];
}
return
len
;
}
}
Back
|
FazBrowse Home
|
New Git URL