摘要: class Solution {public: ListNode *removeNthFromEnd(ListNode *head, int n) { ListNode *a=head,*b=head; int i=0; ListNode *pre=head; while(inext; i++; } while(a!=NULL&&b!=NULL) { pre=b; a=a->next; b=b->ne... 阅读全文
posted @ 2013-06-24 16:21 代码改变未来 阅读(160) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: string convert(string s, int nRows) { string ret; int n=s.size(); vectorv(nRows); for(int i=0;i0&&iv(nRows); for(int i=0;i0;j--,i++) v[j]+=s[i]; } for(int i=0;i<nRows;i++) { for(int j=0;j<v[i... 阅读全文
posted @ 2013-06-24 15:28 代码改变未来 阅读(1504) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: bool isMatch(const char *s, const char *p) { // Start typing your C/C++ solution below // DO NOT write int main() function if (*p == '*'){//return true; while(*p == '*') ++p; if (*p == '\0') return true; while(*s != '\0... 阅读全文
posted @ 2013-06-24 14:11 代码改变未来 阅读(230) 评论(0) 推荐(0) 编辑