LeetCode
文章平均质量分 71
lawenliu
这个作者很懒,什么都没留下…
展开
-
在旋转后有序数组中查找指定数(Search in Rotated Sorted Array)
题目Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are given a target value to search. If found in the array return i...原创 2020-01-16 11:35:35 · 907 阅读 · 0 评论 -
移除有序数组的重复数字 2(Remove Duplicates from Sorted Array II)
题目Follow up for "Remove Duplicates": What if duplicates are allowed at most twice?For example, Given sorted array A = [1, 1, 1, 2, 2, 3],Your function should return length = 5, and A is now [1, 1,...原创 2020-01-15 18:50:52 · 330 阅读 · 0 评论 -
移除有序数组的重复数字(Remove Duplicates from Sorted Array)
题目Given a sorted array, remove the duplicates in place such that each element appear onlyonce and return the new length.Do not allocate extra space for another array, you must do this in place wit...原创 2020-01-08 19:35:39 · 636 阅读 · 0 评论 -
LeetCode 题目解析
所有代码均是基于C++11实现,有部分代码参考了其他同学的实现。这里只做部分test,test case写的有限,并不会cover所有的Corner case。大家可以只作为参考,添加更多的test case。有些面试官会让你自己写test cases,并自己去跑测试验证自己的代码。面试的一些小提示1. 自我介绍可以比较简短,着重介绍自己做的成绩和产出就行了,比如在**公司的**项目中采用......原创 2020-01-08 19:22:06 · 542 阅读 · 0 评论