Submission Detail

57 / 57 test cases passed.
Status:

Accepted

Runtime: 48 ms
Memory Usage: 43.9 MB
Submitted: 2 weeks, 1 day ago
loading
Runtime Error Message:
Last executed input:
Input:
Output:
Expected:

Accepted Solutions Runtime Distribution

0
10
20
30
40
50
60
70
80
90
100
110
120
130
140
5
10
15
20
java
You are here!
Your runtime beats 50.92 % of java submissions.
Runtime (ms)
Distribution (%)

0
20
40
60
80
100
120
140
10
20
Zoom area by dragging across this chart

Accepted Solutions Memory Distribution

41000
41500
42000
42500
43000
43500
44000
2
4
6
8
10
java
You are here!
Your memory usage beats 19.17 % of java submissions.
Memory (KB)
Distribution (%)

41000
41500
42000
42500
43000
43500
44000
5
10
Zoom area by dragging across this chart

Invite friends to challenge Two Sum


Submitted Code: 2 weeks, 1 day ago

Language: java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
class Solution {
public int[] twoSum(int[] nums, int target) {
int[] indices = new int[2];
for (int i = 0; i < nums.length; i++) {
for (int j = i+1; j < nums.length; j++) {
if ((nums[i] + nums[j]) == target) {
indices[0] = i;
indices[1] = j;
}
}
}
return indices;
}
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX