Skip to content

Commit 64f4c45

Browse files
a
1 parent 493d736 commit 64f4c45

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Diff for: src/FirstMissingPositive.java

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// S: O(1)
44

55
public class FirstMissingPositive {
6-
public static int firstMissingPositive(int[] nums) {
6+
public int firstMissingPositive(int[] nums) {
77
int n = nums.length;
88

99
// Use cycle sort to place positive elements smaller than n at the correct index
@@ -32,8 +32,4 @@ private static void swap(int[] nums, int i, int j) {
3232
nums[i] = nums[j];
3333
nums[j] = temp;
3434
}
35-
36-
public static void main(String[] args) {
37-
System.out.println(firstMissingPositive(new int[] {3, 4, -1, 1}));
38-
}
3935
}

0 commit comments

Comments
 (0)