摘要:
From each pointer, spread to the board. One tricky is set the char that used to be 0. Set it back when finished searching. 1 class Solution { 2 privat...
阅读全文
posted @ 2015-03-25 13:47
keepshuatishuati
阅读(128)
推荐(0)
摘要:
1 class Solution { 2 public: 3 string convert(string s, int nRows) { 4 if (nRows < 2) return s; 5 int len = s.size(), size = 2*nR...
阅读全文
posted @ 2015-03-25 09:25
keepshuatishuati
阅读(104)
推荐(0)
摘要:
Do the BFS and use a hashset to record whether the word has been found before. 1 class Solution { 2 public: 3 int ladderLength(string start, strin...
阅读全文
posted @ 2015-03-25 09:20
keepshuatishuati
阅读(132)
推荐(0)
摘要:
Do not confused with min cut again!!!!!!!!!!!! 1 class Solution { 2 public: 3 bool canBreak(string s, unordered_set &dict) { 4 int len = s...
阅读全文
posted @ 2015-03-25 09:11
keepshuatishuati
阅读(125)
推荐(0)
摘要:
Differentiate it with Palindrome min cut!!!!!!!!! 1 class Solution { 2 public: 3 bool wordBreak(string s, unordered_set &dict) { 4 int len...
阅读全文
posted @ 2015-03-25 08:18
keepshuatishuati
阅读(134)
推荐(0)
摘要:
Inorder traversal the tree and compare one by one. 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode *l...
阅读全文
posted @ 2015-03-25 08:00
keepshuatishuati
阅读(114)
推荐(0)
摘要:
Everytime forget to - '0'!!!!!!! 1 class Solution { 2 public: 3 bool isValid(vector &rec, int value) { 4 if (value > &board) {10 ...
阅读全文
posted @ 2015-03-25 07:52
keepshuatishuati
阅读(113)
推荐(0)
摘要:
1 class Solution { 2 public: 3 bool isValid(string s) { 4 int len = s.size(); 5 if (len%2 == 1) return false; 6 stack lis...
阅读全文
posted @ 2015-03-25 07:45
keepshuatishuati
阅读(150)
推荐(0)
摘要:
1 class Solution { 2 public: 3 string preProcess(string s) { 4 string result; 5 for (int i = 0; i = 'a' && s[i] = '0' && s[i] = '...
阅读全文
posted @ 2015-03-25 07:31
keepshuatishuati
阅读(129)
推荐(0)