- 博客(5)
- 收藏
- 关注
原创 Leetcode问题解答:215. Kth Largest Element in an Array
难度:medium 原链接 Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. For example, Given [3,2,1,5,6,4]
2017-09-28 14:03:40 137
原创 leetcode问题解答:23. Merge k Sorted Lists
难度:hard 原链接 解答思路: 感觉一点也不hard。。把mergesort中的merge过程扩展到k个有序列就可以了,在实现上注意一些边界的处理,比如遇到NULL值要如何反应等等 代码: class Solution { public: ListNode* mergeKLists(vector& lists) { ListNode* head = NULL;
2017-09-21 14:53:51 139
原创 Leetcode问题解答:3. Longest Substring Without Repeating Characters
难度:MEdium 原链接 描述: Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the length is 3. Given "bbbb
2017-09-21 12:35:34 112
原创 LeetCode问题解答:19. Remove Nth Node From End of List
难度:Medium 源链接:https://leetcode.com/problems/remove-nth-node-from-end-of-list/description/ 描述: Given a linked list, remove the nth node from the end of list and return its head. Note: Given n
2017-09-14 16:22:55 119
原创 Leetcode问题解答:4. Median of Two Sorted Arrays
问题难度:Hard 源链接:https://leetcode.com/problems/median-of-two-sorted-arrays/description/ 描述: There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two
2017-09-14 10:57:48 154
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人