File tree 2 files changed +4
-6
lines changed
2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -25,9 +25,8 @@ return [0, 1].
25
25
``` java
26
26
class Solution {
27
27
public int [] twoSum (int [] nums , int target ) {
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) {
31
30
if (nums[i] + nums[j] == target) {
32
31
return new int []{i, j};
33
32
}
Original file line number Diff line number Diff line change 13
13
*/
14
14
public class Solution {
15
15
// 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) {
19
18
// if (nums[i] + nums[j] == target) {
20
19
// return new int[]{i, j};
21
20
// }
You can’t perform that action at this time.
0 commit comments