LeetCode OJ
cfsht
这个作者很懒,什么都没留下…
展开
-
LeetCode OJ---27. 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.原创 2016-11-19 22:40:57 · 262 阅读 · 0 评论 -
LeetCode OJ---1. Two Sum
Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution.Example:Given nu原创 2016-11-21 15:13:55 · 260 阅读 · 0 评论 -
LeetCode OJ---217. Contains Duplicate
Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element原创 2016-11-21 15:28:06 · 276 阅读 · 0 评论 -
LeetCode OJ---203. Remove Linked List Elements
Remove all elements from a linked list of integers that have value val.ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return: 1 --> 2 --> 3 --> 4 --> 5Code:/** * D原创 2016-10-19 21:56:09 · 252 阅读 · 0 评论 -
LeetCode OJ---234. Palindrome Linked List
Given a singly linked list, determine if it is a palindrome.Follow up:Could you do it in O(n) time and O(1) space?Subscribe to see which companies asked this question/** * Defini原创 2016-10-19 20:44:32 · 332 阅读 · 0 评论 -
LeetCode OJ---66. Plus One
Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at the head of the list.// 算法设计得相当巧妙,可以多学习学习原创 2016-11-21 16:29:40 · 243 阅读 · 0 评论