- 博客(2)
- 收藏
- 关注
原创 leetcode 题解 自主实现atoi()函数
int atoi(const char *str) { int sign = 1, base = 0, i = 0; while (str[i] == ' ') { i++; } //丢弃空白字符 if (str[i] == '-' || str[i] == '+') { sign = 1 - 2 * (str[i++] == '-'); } whil
2016-09-02 16:18:08 196
原创 leetcode 10 Regular Expression Matching
此题利用动态规划,建立一个二维数组 class Solution { public: bool isMatch(string s, string p) { vector > match_flag(s.length() + 1,vector(p.length() + 1,false)); match_flag[0][0] = true;
2016-05-19 17:14:09 148
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人