考查,最高位有进位 1 class Solution { 2 public: 3 vector plusOne(vector &digits) { 4 // IMPORTANT: Please reset any member data you declared, as 5 ...
分类:
其他好文 时间:
2014-09-04 23:36:30
阅读次数:
256
Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"((()))...
分类:
其他好文 时间:
2014-09-04 22:17:00
阅读次数:
185
Divide two integers without using multiplication, division and mod operator.思路:取被除数和除数的绝对值求解即可。不过,需要考虑特殊情况:INT_MIN取绝对值仍然是INT_MIN。 1 class Solution { 2...
分类:
其他好文 时间:
2014-09-04 20:46:30
阅读次数:
214
class Solution {
public:
int canCompleteCircuit(vector &gas, vector &cost) {
int len = gas.size();
int tank_all = 0;
int pos = 0;
int tank_cur =0;
for (int i = 0; i < len; i++){
int tank...
分类:
其他好文 时间:
2014-09-04 17:08:19
阅读次数:
181
dfs即可注意边界情况:(1)s长度不在4 和 12之间(2)"010"这种形式是错误的 1 class Solution { 2 public: 3 vector restoreIpAddresses(string s) { 4 vector res; 5 ...
分类:
其他好文 时间:
2014-09-04 10:27:19
阅读次数:
220
public class Solution { public List> generate(int numRows) { List> result = new ArrayList>(); if (numRows oldLine = new ArrayList();...
分类:
其他好文 时间:
2014-09-04 02:47:37
阅读次数:
252
public class Solution { public int[] plusOne(int[] digits) { for (int i=digits.length-1; i>=0; i--) { if (digits[i] != 9) { ...
分类:
其他好文 时间:
2014-09-04 01:36:30
阅读次数:
133
1: 递归public class Solution { public boolean isSymmetric(TreeNode root) { if(root == null) return true; return isTwoTreeSymmet...
分类:
其他好文 时间:
2014-09-04 01:32:37
阅读次数:
194
public class Solution { public void sortColors(int[] A) { for (int i=0,j=0,k=A.length-1; j<=k; ) { if (A[j] == 0) { ...
分类:
其他好文 时间:
2014-09-04 01:31:09
阅读次数:
202
如何在Codebase中添加一个新的ProjectConfig.mk文件,使得其优先级大于
mediatek/config/$project/ProjectConfig.mk
ProjectConfig.mk
优先级大于$project目录下的ProjectConfig.mk文件
[Solution]
Step1. 在mediatek/config下面添加自己的文件夹名称,如testco...
分类:
移动开发 时间:
2014-09-03 13:06:26
阅读次数:
208