Introduction: 新语言, 新思维 Formatting Indentation: 默认tab Line Length: 无限制, 会自动换行 Parentheses: 圆括号, 无限制, 但会自动去掉if, switch, for控制结构中的圆括号. 使用gofmt命令自动格式源码. C... ...
分类:
其他好文 时间:
2016-07-31 20:30:18
阅读次数:
177
需要用递归来做,把input从头到尾走一遍,如果是符号的话,递归算出两边可能的结果,再计算所有的组合。 当然退出的条件是,如果整个input就是一个操作数,那么就把这个数加到结果中去 ...
分类:
其他好文 时间:
2016-07-30 06:53:05
阅读次数:
114
unordered_map<string, vector<int> > book; class Solution { public: vector<int> diffWaysToCompute(string input) { if(book.count(input)) return book[inp ...
分类:
其他好文 时间:
2016-07-25 14:34:25
阅读次数:
109
Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results. Note: The input string may cont ...
分类:
其他好文 时间:
2016-07-23 16:31:05
阅读次数:
130
Given an expression string array, return the Reverse Polish notation of this expression. (remove the parentheses) Given an expression string array, re ...
分类:
其他好文 时间:
2016-07-21 12:44:15
阅读次数:
117
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. Given n pairs of parentheses, write a function ...
分类:
其他好文 时间:
2016-07-19 09:08:46
阅读次数:
113
题目描述: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close i ...
分类:
其他好文 时间:
2016-07-05 01:10:02
阅读次数:
231
题目描述: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. 解题分析: 这类题一般都要用递归的方法来解决。需要设两个集合类分别存储待匹配的( ...
分类:
其他好文 时间:
2016-07-05 01:09:06
阅读次数:
180
Simple Balanced Parentheses write an algorithm that will read a string of parentheses from left to right and decide whether the symbols are balanced. ...
分类:
其他好文 时间:
2016-06-29 01:11:13
阅读次数:
223