Функция getMin() возвращает неправильный ответ в конкретном тестовом примере, и я не понимаю, почему!
Код: Выделить всё
class MinStack {
static ArrayList stack = new ArrayList();
static ArrayList minStack = new ArrayList();
public MinStack() {
}
public void push(int val) {
stack.add(val);
if (minStack.isEmpty() || val [/b]
getMin() возвращает -2 вместо -1
Подробнее здесь: [url]https://stackoverflow.com/questions/78808772/the-getmin-function-returns-an-incorrect-value-in-the-stack-for-leetcode-quest[/url]