摘要: #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 阅读全文
posted @ 2016-11-21 14:40 冯兴伟 阅读(96) 评论(0) 推荐(0)
摘要: #203. Remove Linked List Elements Remove all elements from a linked list of integers that have value val. ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 阅读全文
posted @ 2016-11-21 14:30 冯兴伟 阅读(143) 评论(0) 推荐(0)
摘要: #237. Delete Node in a Linked List Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Suppos 阅读全文
posted @ 2016-11-21 13:46 冯兴伟 阅读(163) 评论(0) 推荐(0)
摘要: #414. Third Maximum Number Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximu 阅读全文
posted @ 2016-11-21 01:58 冯兴伟 阅读(829) 评论(0) 推荐(0)
摘要: #344. Reverse String Write a function that takes a string as input and returns the string reversed. Example: Given s = "hello", return "olleh". 题解:回文串 阅读全文
posted @ 2016-11-21 00:26 冯兴伟 阅读(144) 评论(0) 推荐(0)
摘要: #349. Intersection of Two Arrays Given two arrays, write a function to compute their intersection. Example: Given nums1 = [1, 2, 2, 1], nums2 = [2, 2] 阅读全文
posted @ 2016-11-21 00:14 冯兴伟 阅读(273) 评论(0) 推荐(0)
摘要: #303. Range Sum Query - Immutable Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Example: Note: 阅读全文
posted @ 2016-11-20 23:07 冯兴伟 阅读(727) 评论(0) 推荐(0)
摘要: #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, 阅读全文
posted @ 2016-11-20 22:35 冯兴伟 阅读(131) 评论(0) 推荐(0)
摘要: #53. Maximum Subarray Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the 阅读全文
posted @ 2016-11-20 22:21 冯兴伟 阅读(211) 评论(0) 推荐(0)
摘要: #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 w 阅读全文
posted @ 2016-11-20 16:58 冯兴伟 阅读(137) 评论(0) 推荐(0)
摘要: #100. Same Tree Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structur 阅读全文
posted @ 2016-11-20 16:31 冯兴伟 阅读(207) 评论(0) 推荐(0)
摘要: #70. Climbing Stairs You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many dis 阅读全文
posted @ 2016-11-20 16:30 冯兴伟 阅读(418) 评论(0) 推荐(0)
摘要: #35. Search Insert Position Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would 阅读全文
posted @ 2016-11-20 16:28 冯兴伟 阅读(179) 评论(0) 推荐(0)
摘要: #21. Merge Two Sorted Lists Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of t 阅读全文
posted @ 2016-11-20 16:26 冯兴伟 阅读(178) 评论(0) 推荐(0)
摘要: #19. Remove Nth Node From End of List Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked lis 阅读全文
posted @ 2016-11-20 16:19 冯兴伟 阅读(119) 评论(0) 推荐(0)