leetcode刷题小记
方naoke
学无止境
展开
-
Leetcode_75_Sort Colors
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we will use the integers 0, 1,原创 2017-07-29 17:31:57 · 308 阅读 · 0 评论 -
Leetcode_88_Merge Sorted Array
Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note: You may assume that nums1 has enough space (size that is greater or equal to m + n) to hold additional原创 2017-07-30 16:07:13 · 225 阅读 · 0 评论 -
Leetcode_215_Kth Largest Element in an Array
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] and k = 2, return 5.Note:原创 2017-07-30 16:20:29 · 298 阅读 · 0 评论 -
Leetcode_80_Remove Duplicates from Sorted Array II
题目: Follow up for “Remove Duplicates”: What if duplicates are allowed at most twice?For example, Given sorted array nums = [1,1,1,2,2,3],Your function should return length = 5, with the first five e原创 2017-07-29 11:40:35 · 221 阅读 · 0 评论