上一页 1 2 3 4 5 6 7 ··· 16 下一页
摘要: 题目 给定一个字符串,请你找出其中不含有重复字符的最长子串的长度 思路 unordered__set 具备set互异性的特点,同时对插入的数据保留原顺序,即unordered。 本题的思想为“滑动窗口”,用unordered_set记录已扫描的字符,在插入前判断当前字符是否存在在已扫描的序列中。若存 阅读全文
posted @ 2020-02-28 12:01 阳离子 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 题目 给定两个单词 word1 和 word2,计算出将 word1 转换成 word2 所使用的最少操作数 。 你可以对一个单词进行如下三种操作: 插入一个字符 删除一个字符 替换一个字符 思路 定义一个数组 代表第一个字符串前i个字符转换为第二个字符串前j个字符串所需要的缩少操作数。 如果wor 阅读全文
posted @ 2020-02-28 11:54 阳离子 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 题目 给定一个无重复元素的数组 candidates 和一个目标数 target ,找出 candidates 中所有可以使数字和为 target 的组合。 candidates 中的数字可以无限制重复被选取。 说明: 所有数字(包括 target)都是正整数。 解集不能包含重复的组合。 样例 示例 阅读全文
posted @ 2020-02-27 21:27 阳离子 阅读(216) 评论(0) 推荐(0) 编辑
摘要: Suppose a bank has K windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. All the c 阅读全文
posted @ 2020-02-27 10:35 阳离子 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Suppose a bank has N windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. The rules 阅读全文
posted @ 2020-02-26 18:16 阳离子 阅读(98) 评论(0) 推荐(0) 编辑
摘要: A reversible prime in any number system is a prime whose "reverse" in that number system is also a prime. For example in the decimal system 73 is a re 阅读全文
posted @ 2020-02-22 23:19 阳离子 阅读(187) 评论(0) 推荐(0) 编辑
摘要: To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C Programming Language, Mathematics 阅读全文
posted @ 2020-02-22 22:43 阳离子 阅读(103) 评论(0) 推荐(0) 编辑
摘要: It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that c 阅读全文
posted @ 2020-02-22 22:39 阳离子 阅读(102) 评论(0) 推荐(0) 编辑
摘要: Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is , if 6 is a decimal number and 110 is a bi 阅读全文
posted @ 2020-02-20 12:48 阳离子 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Given a sequence of K integers { N 1, N 2, ..., N K }. A continuous subsequence is defined to be { N i , N i +1, ..., N j } where 1≤ i ≤ j ≤ K . The M 阅读全文
posted @ 2020-02-16 22:21 阳离子 阅读(196) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 16 下一页