min stack solution added