about | help | code help+videos | done | prefs |
Given a Stack of integers, pop the top element off of the stack and return the stack. If the stack has no elements, return an empty stack. YOUR FIRST TWO LINES OF CODE MUST BE: Stack<Integer> stack = new Stack<Integer>(); stack.addAll(list); stack_popStack([1, 2, 3, 4, 5]) → [1, 2, 3, 4] stack_popStack([1, 2, 3]) → [1, 2] stack_popStack([1]) → [] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy