摘要: 给定一句英语,要求你编写程序,将句中所有单词的顺序颠倒输出。 输入格式:测试输入包含一个测试用例,在一行内给出总长度不超过80的字符串。字符串由若干单词和若干空格组成,其中单词是由英文字母(大小写有区分)组成的字符串,单词之间用1个空格分开,输入保证句子末尾没有多余的空格。 输出格式:每个测试用例的 阅读全文
posted @ 2018-06-24 23:39 赖兴宇 阅读(138) 评论(0) 推荐(0) 编辑
摘要: mid=(l+r)/2可能会出错, 应该用mid=l+(r-l)/2; 阅读全文
posted @ 2018-06-24 17:23 赖兴宇 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted array of integers, find the length of longest increasing subsequence. Example: Note: There may be more than one LIS combination, it 阅读全文
posted @ 2018-06-24 17:11 赖兴宇 阅读(164) 评论(0) 推荐(0) 编辑
摘要: Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer target. 阅读全文
posted @ 2018-06-24 15:23 赖兴宇 阅读(158) 评论(0) 推荐(0) 编辑
摘要: Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. A mapping of digit to le 阅读全文
posted @ 2018-06-24 14:32 赖兴宇 阅读(184) 评论(0) 推荐(0) 编辑