Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9b4614e

Browse files
refactor 80
1 parent444696c commit9b4614e

File tree

1 file changed

+2
-9
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+2
-9
lines changed

‎src/main/java/com/fishercoder/solutions/_80.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,9 @@ public static class Solution1 {
99
publicintremoveDuplicates(int[]nums) {
1010
intcounter =0;
1111
intlen =nums.length;
12-
if (len==0) {
13-
return0;
12+
if (len<3) {
13+
returnlen;
1414
}
15-
if (len ==1) {
16-
return1;
17-
}
18-
if (len ==2) {
19-
return2;
20-
}
21-
2215
List<Integer>a =newArrayList();
2316
a.add(nums[0]);
2417
a.add(nums[1]);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp