using deque == stack from JAVA collection APi wrote  a balanced collection checker