上一页 1 2 3 4 5 6 7 ··· 10 下一页
摘要: 1 /* 2 struct ListNode { 3 int val; 4 struct ListNode *next; 5 ListNode(int x) : 6 val(x), next(NULL) { 7 } 8 };*/ 9 class Solution { 10 public: 11 Li 阅读全文
posted @ 2016-07-26 15:22 Pearl_zju 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 1 //无论分割点在何处,s2总是s1S1的子串 2 class ReverseEqual { 3 public: 4 bool checkReverseEqual(string s1, string s2) { 5 // write code here 6 int len1 = s1.length 阅读全文
posted @ 2016-07-26 14:36 Pearl_zju 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 一、全排列的递归实现(不考虑去重) 从第一个数字起,每个数分别与它后面的数字交换。 全排列的递归实现:123的全排列如下:swap1: 123swap1: 123第1个排列 : 123swap2: 123swap1: 132第2个排列 : 132swap2: 123swap2: 123swap1: 阅读全文
posted @ 2016-07-25 21:24 Pearl_zju 阅读(297) 评论(0) 推荐(0) 编辑
摘要: 1 class Clearer { 2 public: 3 vector<vector<int> > clearZero(vector<vector<int> > mat, int n) { 4 // write code here 5 int nrow=mat.size(); 6 int ncol 阅读全文
posted @ 2016-07-25 17:07 Pearl_zju 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 1 class Transform { 2 public: 3 vector<vector<int> > transformImage(vector<vector<int> > mat, int n) 4 { 5 for(int layer=0;layer<n/2;++layer) 6 { 7 in 阅读全文
posted @ 2016-07-25 16:19 Pearl_zju 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 1 class Zipper { 2 public: 3 string zipString(string iniString) { 4 // write code here 5 string out; 6 char ch=iniString[0]; 7 int n = 0; 8 for(int i= 阅读全文
posted @ 2016-07-23 22:56 Pearl_zju 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 1 class Replacement { 2 public: 3 string replaceSpace(string iniString, int length) { 4 // write code here 5 for(int m=0;m<iniString.size();) 6 { 7 in 阅读全文
posted @ 2016-07-23 21:47 Pearl_zju 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 方法1 方法2 阅读全文
posted @ 2016-07-23 21:23 Pearl_zju 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 1 class Reverse { 2 public: 3 string reverseString(string iniString) { 4 // write code here 5 string::iterator b=iniString.begin(); 6 string::iterator 阅读全文
posted @ 2016-07-23 21:21 Pearl_zju 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 1 class Different { 2 public: 3 bool checkDifferent(string iniString) { 4 // write code here 5 int len=iniString.size(); 6 if(len>256) 7 return false; 阅读全文
posted @ 2016-07-23 21:19 Pearl_zju 阅读(237) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 10 下一页