Remove All Adjacent Duplicates In String
就是找到并且去除回文啊。。用stack检查
就是找到并且去除回文啊。。用stack检查
public boolean isValidParentheses(String s) { // Write your code here Stack<Character> st = new Stack<Character>(); if(s.length() == 0 || s == null) return false; for(int i = 0 ; i < s.length(); i++) { if(s.charAt(i) == ‘(‘ || s.charAt(i) == ‘[‘ || s.charAt(i) == ‘{‘) st.push(s.charAt(i)); else{ if(st.isEmpty()) return false; if(s.charAt(i) == ‘)’ && st.peek() […]