摘要: 题目: 给定两个大小为 m 和 n 的有序数组 nums1 和 nums2。 请你找出这两个有序数组的中位数,并且要求算法的时间复杂度为 O(log(m + n))。 你可以假设 nums1 和 nums2 不会同时为空。 示例 1: nums1 = [1, 3] nums2 = [2] 则中位数是 阅读全文
posted @ 2019-06-24 21:42 mingyu02 阅读(277) 评论(0) 推荐(0)
摘要: 题目描述: 给定一个字符串,请你找出其中不含有重复字符的 最长子串 的长度。 示例 1: 输入: "abcabcbb" 输出: 3 解释: 因为无重复字符的最长子串是 "abc",所以其长度为 3。 示例 2: 输入: "bbbbb" 输出: 1 解释: 因为无重复字符的最长子串是 "b",所以其长 阅读全文
posted @ 2019-06-22 22:43 mingyu02 阅读(302) 评论(0) 推荐(0)
摘要: 题目描述: 给出两个 非空 的链表用来表示两个非负的整数。其中,它们各自的位数是按照 逆序 的方式存储的,并且它们的每个节点只能存储 一位 数字。 如果,我们将这两个数相加起来,则会返回一个新的链表来表示它们的和。 您可以假设除了数字 0 之外,这两个数都不会以 0 开头。 示例: 输入:(2 4 阅读全文
posted @ 2019-06-22 21:30 mingyu02 阅读(317) 评论(0) 推荐(0)
摘要: "传送门" "传送门2" 阅读全文
posted @ 2019-06-22 13:28 mingyu02 阅读(379) 评论(0) 推荐(0)
摘要: 上传文件 删除文件: 阅读全文
posted @ 2019-06-21 20:46 mingyu02 阅读(438) 评论(0) 推荐(0)
摘要: 题目描述见2-1 代码: 阅读全文
posted @ 2019-06-21 01:57 mingyu02 阅读(103) 评论(0) 推荐(0)
摘要: 题目: 给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。 你可以假设每种输入只会对应一个答案。但是,你不能重复利用这个数组中同样的元素。 示例: 给定 nums = [2, 7, 11, 15], target = 9 因为 阅读全文
posted @ 2019-06-20 01:56 mingyu02 阅读(260) 评论(0) 推荐(0)
摘要: 题目描述: Implement int sqrt(int x). Compute and return the square root of x, where x is guaranteed to be a non-negative integer. Since the return type is 阅读全文
posted @ 2019-06-18 23:38 mingyu02 阅读(137) 评论(0) 推荐(0)
摘要: 题目描述: Given an array with n objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the colors in 阅读全文
posted @ 2019-06-18 01:37 mingyu02 阅读(91) 评论(0) 推荐(0)
摘要: 题目描述: Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The solution set must not contain duplicate subsets. 阅读全文
posted @ 2019-06-16 21:57 mingyu02 阅读(110) 评论(0) 推荐(0)