Leetcode刷题记录
希望能坚持
一只小奶狗
SCU Master
展开
-
LeetCode 热题100答案
leetcode 热题100文章目录leetcode 热题100[2. 两数相加](https://leetcode-cn.com/problems/add-two-numbers/)[3. 无重复字符的最长子串](https://leetcode-cn.com/problems/longest-substring-without-repeating-characters/)[4. 寻找两个正序数组的中位数](https://leetcode-cn.com/problems/median-of-two-s原创 2020-06-26 17:49:22 · 2072 阅读 · 0 评论 -
【LeetCode39】组合总和
描述给定一个无重复元素的数组 candidates 和一个目标数 target ,找出 candidates 中所有可以使数字和为 target 的组合。candidates 中的数字可以无限制重复被选取。说明:所有数字(包括 target)都是正整数。解集不能包含重复的组合。示例 1:输入: candidates = [2,3,6,7], target = 7,所求解集为:[[7],[2,2,3]]示例 2:输入: candidates = [2,3,5], target =原创 2020-05-20 18:23:19 · 124 阅读 · 0 评论 -
【LeetCode34】在排序数组中查找元素的第一个和最后一个位置
描述给定一个按照升序排列的整数数组 nums,和一个目标值 target。找出给定目标值在数组中的开始位置和结束位置。你的算法时间复杂度必须是 O(log n) 级别。如果数组中不存在目标值,返回 [-1, -1]。示例 1:输入: nums = [5,7,7,8,8,10], target = 8输出: [3,4]示例 2:输入: nums = [5,7,7,8,8,10], target = 6输出: [-1,-1]来源:力扣(LeetCode)链接:https://leetcod原创 2020-05-20 18:00:40 · 92 阅读 · 0 评论 -
【LeetCode33】搜索旋转排序数组
假设按照升序排序的数组在预先未知的某个点上进行了旋转。( 例如,数组 [0,1,2,4,5,6,7] 可能变为 [4,5,6,7,0,1,2] )。搜索一个给定的目标值,如果数组中存在这个目标值,则返回它的索引,否则返回 -1 。你可以假设数组中不存在重复的元素。你的算法时间复杂度必须是 O(log n) 级别。来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/search-in-rotated-sorted-array著作权归领扣网络所有。原创 2020-05-20 17:48:47 · 107 阅读 · 0 评论