
----1.2.2Leetcode
XuRuiIsCoding
这个作者很懒,什么都没留下…
展开
-
Leetcode - 283 - moveZeros
题目 Given an array nums, write a function to move all 0’s to the end of it while maintaining the relative order of the non-zero elements.For example, given nums = [0, 1, 0, 3, 12], after calling your原创 2017-11-09 10:51:17 · 512 阅读 · 0 评论 -
Leetcode - 80 -removeDuplicates
题目 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 fiv原创 2017-11-09 16:51:06 · 460 阅读 · 0 评论 -
Leetcode - 75 - sortColors
题目 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 int...原创 2017-11-09 17:28:43 · 265 阅读 · 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, ret...原创 2017-11-10 12:34:28 · 376 阅读 · 0 评论 -
Leetcode - 209 - minSubArrary
题目: Given an array of n positive integers and a positive integer s, find the minimal length of a contiguous subarray of which the sum ≥ s. If there isn’t one, return 0 instead.For example, give...原创 2017-11-10 15:38:18 · 464 阅读 · 0 评论 -
Leetcode - 349 - Intersection of Two Arrays - 类型转化,String<->int,object<->int
题目: Given two arrays, write a function to compute their intersection.Example: Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2].Note:Each element in the result must be unique.The result can b翻译 2017-11-16 16:22:15 · 266 阅读 · 0 评论 -
leetcode-203. Remove Linked List Elements-C++
Remove Linked List Elements Remove all elements from a linked list of integers that have value val.Example Given: 1 –> 2 –> 6 –> 3 –> 4 –> 5 –> 6, val = 6 Return: 1 –> 2 –&...原创 2018-03-24 21:27:53 · 685 阅读 · 0 评论