【leetcode_easy_stack】1021. Remove Outermost Parentheses problem 1021. Remove Outermost Parentheses solution#1: stack; code solution#2: code 参考 1.leetcode_easy_stack_1021. Remove Outermost Parentheses; 2.【leetcode刷题】1021. Remove Outermost Parentheses; 完 各美其美,美美与共,不和他人作比较,不对他人有期待,不批判他人,不钻牛角尖...
1047. Remove All Adjacent Duplicates In String solution#1: 使用stack; code: solution#2: 快慢指针; code solution#3: 数据类型string的特性; code 参考 1.leetcode_easy_stack_1047. Remove All Adjacent Duplicates In String; 完 各美其美,美美与共,不和他人作比较,不对他人有期待,不批判他人,不钻牛角...
最后要删除leading 0 1publicclassSolution {2publicString removeKdigits(String num,intk) {3if(num.length()==0 || k>=num.length())return"0";4char[] arr =num.toCharArray();5Stack<Character> stack =newStack<Character>();6StringBuilder res =newStringBuilder();7intsize = arr.length -k;8...