Uber interview question

Node problem using a stack