Skip to content

Commit 74e978e

Browse files
committed
rivkode missing number array 풀이 추가
1 parent 60ef283 commit 74e978e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

missing-number/rivkode.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@
2929

3030
class Solution {
3131
public int missingNumber(int[] nums) {
32+
/*
33+
Array 풀이
34+
Arrays.sort(nums);
35+
36+
for (int i=0; i<nums.length; i++) {
37+
if (nums[i] != i) {
38+
return i;
39+
}
40+
}
41+
42+
return nums.length;
43+
*/
3244
Set<Integer> set = new HashSet<>();
3345

3446
for (int i: nums) {

0 commit comments

Comments
 (0)