Skip to content

Commit 0ac8ad4

Browse files
format
1 parent ecf5c68 commit 0ac8ad4

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ Your ideas/fixes/algorithms are more than welcome!
407407
|167|[Two Sum II - Input array is sorted](https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_167.java)| O(logn)|O(1) | Easy|
408408
|166|[Fraction to Recurring Decimal](https://leetcode.com/problems/fraction-to-recurring-decimal/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_166.java) | O(1) |O(1) | Medium| HashMap
409409
|165|[Compare Version Numbers](https://leetcode.com/problems/compare-version-numbers/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_165.java)| O(n)|O(1) | Easy|
410-
|164|[Maximum Gap](https://leetcode.com/problems/maximum-gap/)|[Solution](../master/src/main/java/com/fishercoder/solutions/MaximumGap.java) | O(n) |O(n) | Hard|
410+
|164|[Maximum Gap](https://leetcode.com/problems/maximum-gap/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_164.java) | O(n) |O(n) | Hard|
411411
|163|[Missing Ranges](https://leetcode.com/problems/missing-ranges/)|[Solution](../master/src/main/java/com/fishercoder/solutions/MissingRanges.java) | O(n) |O(1) | |
412412
|162|[Find Peak Element](https://leetcode.com/problems/find-peak-element/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_162.java) | O(1) |O(logn)/O(n) | Binary Search|
413413
|161|[One Edit Distance](https://leetcode.com/problems/one-edit-distance/)|[Solution](../master/src/main/java/com/fishercoder/solutions/OneEditDistance.java) | O(n) |O(1) | |

src/main/java/com/fishercoder/solutions/MaximumGap.java renamed to src/main/java/com/fishercoder/solutions/_164.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@
44

55
/**
66
* Given an unsorted array, find the maximum difference between the successive elements in its sorted form.
7-
* <p>
87
* Try to solve it in linear time/space.
9-
* <p>
108
* Return 0 if the array contains less than 2 elements.
11-
* <p>
129
* You may assume all elements in the array are non-negative integers and fit in the 32-bit signed integer range.
1310
*/
14-
public class MaximumGap {
11+
public class _164 {
1512
//brute force
1613
public int maximumGap(int[] nums) {
1714
if (nums.length < 2) return 0;

src/test/java/com/fishercoder/MaximumGapTest.java renamed to src/test/java/com/fishercoder/_164Test.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
package com.fishercoder;
22

3-
import com.fishercoder.solutions.MaximumGap;
3+
import com.fishercoder.solutions._164;
44
import org.junit.Before;
55
import org.junit.BeforeClass;
66
import org.junit.Test;
77

88
import static junit.framework.Assert.assertEquals;
99

10-
public class MaximumGapTest {
11-
private static MaximumGap test;
10+
public class _164Test {
11+
private static _164 test;
1212
private static int expected;
1313
private static int actual;
1414
private static int[] nums;
1515

1616
@BeforeClass
1717
public static void setup(){
18-
test = new MaximumGap();
18+
test = new _164();
1919
}
2020

2121
@Before

0 commit comments

Comments
 (0)