随笔分类 -  array (partition挡板)

75 - Sort Colors
摘要:75 - Sort Colors https://www.youtube.com/watch?v=yTwW8WiGrKw 75, sort colors, rainbow sort .. sort k colors Given an array with n objects colored red, 阅读全文

posted @ 2018-08-09 17:22 猪猪🐷

80. Remove Duplicates from Sorted Array II
摘要:Given a sorted array nums, remove the duplicates in-place such that duplicates appeared at most twice and return the new length. Do not allocate extra 阅读全文

posted @ 2018-08-09 17:13 猪猪🐷

26. Remove Duplicates from Sorted Array
摘要:Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length. Do not allocate extra spa 阅读全文

posted @ 2018-07-18 08:47 猪猪🐷

27. Remove Element
摘要:Given an array nums and a value val, remove all instances of that value in-place and return the new length. Do not allocate extra space for another ar 阅读全文

posted @ 2018-07-18 08:46 猪猪🐷

283. Move Zeroes
摘要: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. Example: Note: 阅读全文

posted @ 2018-07-18 08:44 猪猪🐷

189. Rotate Array
摘要:Given an array, rotate the array to the right by k steps, where k is non-negative. Example 1: Example 2: Note: Try to come up as many solutions as you 阅读全文

posted @ 2018-07-18 08:43 猪猪🐷

导航