摘要: Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number. An example is the root-to-leaf path1->2->3which re 阅读全文
posted @ 2016-06-29 10:35 ranran1203 阅读(184) 评论(0) 推荐(0)
摘要: Given a 2D board containing'X'and'O', capture all regions surrounded by'X'. A region is captured by flipping all'O's into'X's in that surrounded regio 阅读全文
posted @ 2016-06-29 09:49 ranran1203 阅读(232) 评论(0) 推荐(0)
摘要: Given a string s, partition s such that every substring of the partition is a palindrome. Return the minimum cuts needed for a palindrome partitioning 阅读全文
posted @ 2016-06-28 17:41 ranran1203 阅读(278) 评论(0) 推荐(0)
摘要: Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. For exampl 阅读全文
posted @ 2016-06-28 15:27 ranran1203 阅读(293) 评论(0) 推荐(0)
摘要: Clone an undirected graph. Each node in the graph contains alabeland a list of itsneighbors. OJ's undirected graph serialization: Nodes are labeled un 阅读全文
posted @ 2016-06-28 13:46 ranran1203 阅读(292) 评论(0) 推荐(0)
摘要: There are N gas stations along a circular route, where the amount of gas at station i isgas[i]. You have a car with an unlimited gas tank and it costs 阅读全文
posted @ 2016-06-27 17:25 ranran1203 阅读(130) 评论(0) 推荐(0)
摘要: string 由头文件<string>支持,支持的对象可以是字符也可以是宽字符 1、初始化 string str("1234567"); char ch[]="abcdefg"; string a; string str_1(str);//使用str初始化 string str_2(str,2,5) 阅读全文
posted @ 2016-06-27 14:52 ranran1203 阅读(209) 评论(0) 推荐(0)
摘要: There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the following re 阅读全文
posted @ 2016-06-27 10:42 ranran1203 阅读(196) 评论(0) 推荐(0)
摘要: 输入 i come from tianjin. 输出 tianjin. from come i int main(){ int i = 0, j = 0, flag = 0, begin, end; char str[] = "i come from tianjin."; char temp; j 阅读全文
posted @ 2016-06-26 10:26 ranran1203 阅读(169) 评论(0) 推荐(0)
摘要: 输入“1234567",字串”234“,返回”2345678“ const char * strstr2(const char * string, char *string2){ for (int i = 0; string[i] != '\0'; i++) { int j = 0;//每次字串都要 阅读全文
posted @ 2016-06-25 23:06 ranran1203 阅读(173) 评论(0) 推荐(0)