You are viewing a single comment's thread. Return to all comments →
Someone provided the solution.
if(S.peek()==largest_stack.peek()){ largest_stack.pop(); }
should be
if((S.peek()).equals(largest_stack.peek())){ largest_stack.pop(); }
Seems like cookies are disabled on this browser, please enable them to open this website
Maximum Element
You are viewing a single comment's thread. Return to all comments →
Someone provided the solution.
should be