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

Commit9ad9da8

Browse files
committed
opt: opt 001
1 parente7fea38 commit9ad9da8

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

‎note/001/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ return [0, 1].
2525
```java
2626
classSolution {
2727
publicint[]twoSum(int[]nums,inttarget) {
28-
int st=0, end= nums.length;
29-
for (int i=0; i< end;++i) {
30-
for (int j= i+1; j< end;++j) {
28+
for (int i=0; i< nums.length;++i) {
29+
for (int j= i+1; j< nums.length;++j) {
3130
if (nums[i]+ nums[j]== target) {
3231
returnnewint[]{i, j};
3332
}

‎src/com/blankj/easy/_001/Solution.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313
*/
1414
publicclassSolution {
1515
// public int[] twoSum(int[] nums, int target) {
16-
// int st = 0, end = nums.length;
17-
// for (int i = 0; i < end; ++i) {
18-
// for (int j = i + 1; j < end; ++j) {
16+
// for (int i = 0; i < nums.length; ++i) {
17+
// for (int j = i + 1; j < nums.length; ++j) {
1918
// if (nums[i] + nums[j] == target) {
2019
// return new int[]{i, j};
2120
// }

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp