Skip to content

Commit 3355100

Browse files
committed
fd
1 parent 73149d1 commit 3355100

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

facebook/src/main/java/com/leetcode/facebook/FlattenNestedListIterator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.leetcode.facebook;
22

3-
import com.inuker.solution.NestedInteger;
3+
import com.leetcode.library.NestedInteger;
44

55
import java.util.Iterator;
66
import java.util.List;

solution/src/main/java/com/inuker/solution/NestedInteger.java renamed to library/src/main/java/com/leetcode/library/NestedInteger.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.inuker.solution;
1+
package com.leetcode.library;
22

33
import java.util.List;
44

solution/src/main/java/com/inuker/solution/NestedIterator.java renamed to solution/src/main/java/com/inuker/solution/FlattenNestedListIterator.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.inuker.solution;
22

3+
import com.leetcode.library.NestedInteger;
4+
35
import java.util.Iterator;
46
import java.util.List;
57
import java.util.Stack;
@@ -8,11 +10,11 @@
810
* Created by dingjikerbo on 2016/11/22.
911
*/
1012

11-
public abstract class NestedIterator implements Iterator<Integer> {
13+
public abstract class FlattenNestedListIterator implements Iterator<Integer> {
1214

1315
private Stack<NestedInteger> stack;
1416

15-
public NestedIterator(List<NestedInteger> nestedList) {
17+
public FlattenNestedListIterator(List<NestedInteger> nestedList) {
1618
stack = new Stack<NestedInteger>();
1719
push(nestedList);
1820
}

solution/src/main/java/com/inuker/solution/SlidingWindowMaximum.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public int[] maxSlidingWindow2(int[] nums, int k) {
5151
queue.pollLast();
5252
}
5353
queue.offerLast(i);
54-
if (queue.peekFirst() + k <= i) {
54+
if (queue.peekFirst() <= i - k) {
5555
queue.pollFirst();
5656
}
5757
if (i - k + 1 >= 0) {

0 commit comments

Comments
 (0)