fix min stack solution for constant time