'while (k > 0) {' -> 'while (k > 0 && !stack.isEmpty()) {' (java.util.EmptyStackException)
parent
465e997d84
commit
5472520ede
|
@ -75,7 +75,7 @@ class Solution {
|
|||
}
|
||||
stack.push(i);
|
||||
}
|
||||
while (k > 0) {
|
||||
while (k > 0 && !stack.isEmpty()) {
|
||||
stack.pop();
|
||||
k--;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue