LeetCode ---- Array
ReedLi
on the way
展开
-
Contains Duplicate II
欢迎使用Markdown编辑器写博客本Markdown编辑器使用StackEdit修改而来,用它写博客,将会带来全新的体验哦: Markdown和扩展Markdown简洁的语法 代码块高亮 图片链接和图片上传 LaTex数学公式 UML序列图和流程图 离线写博客 导入导出Markdown文件 丰富的快捷键 快捷键 加粗 Ctrl + B 斜体 Ctrl + I 引用 Ctrl原创 2016-06-14 16:56:53 · 290 阅读 · 0 评论 -
Rotate Array
Rotate an array of n elements to the right by k steps.For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4].思路: 1、以数组右侧第k个元素为界,将一个数组分成两部分。如数组[1,2,3,4,5,6,7],k=3,则分原创 2016-06-15 14:36:47 · 273 阅读 · 0 评论 -
Remove Element
Given an array and a value, remove all instances of that value in place and return the new length.Do not allocate extra space for another array, you must do this in place with constant memory.The order原创 2016-06-16 20:59:40 · 244 阅读 · 0 评论