摘要: https://leetcode.com/problems/jump-game/Given an array of non-negative integers, you are initially positioned at the first index of the array.Each ele... 阅读全文
posted @ 2015-05-07 22:17 打小孩 阅读(135) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/Say you have an array for which theithelement is the price of a given stock on dayi.D... 阅读全文
posted @ 2015-05-07 20:01 打小孩 阅读(102) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/reverse-words-in-a-string/Given an input string, reverse the string word by word.For example,Given s = "the sky is blue"... 阅读全文
posted @ 2015-05-07 18:29 打小孩 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 题目描述:输入字符串s和字符c,要求去掉s中所有的c字符,并输出结果。输入:测试数据有多组,每组输入字符串s和字符c。输出:对于每组输入,输出去除c字符后的结果。样例输入:healloa样例输出:hello来源:2009年哈尔滨工业大学计算机研究生机试真题 1 import java.math.Bi... 阅读全文
posted @ 2015-05-07 17:29 打小孩 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 题目描述:输入一个字符串,以回车结束(字符串长度<=100)。该字符串由若干个单词组成,单词之间用一个空格隔开,所有单词区分大小写。现需要将其中的某个单词替换成另一个单词,并输出替换之后的字符串。输入:多组数据。每组数据输入包括3行,第1行是包含多个单词的字符串 s,第2行是待替换的单词a,(长度<... 阅读全文
posted @ 2015-05-07 17:19 打小孩 阅读(403) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/3sum/Given an arraySofnintegers, are there elementsa,b,cinSsuch thata+b+c= 0? Find all unique triplets in the array whic... 阅读全文
posted @ 2015-05-07 12:31 打小孩 阅读(138) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/single-number-ii/https://leetcode.com/discuss/6632/challenge-me-thxGiven an array of integers, every element appearsthre... 阅读全文
posted @ 2015-05-07 11:01 打小孩 阅读(101) 评论(0) 推荐(0) 编辑