- 博客(13)
- 资源 (2)
- 收藏
- 关注
原创 leetcode刷题记录-242. Valid Anagram
leetcode刷题记录-242. Valid Anagram 1.题目要求 Given two strings s and t, write a function to determine if t is an anagram of s. Note: You may assume the string contains only lowercase alphabets. ...
2018-04-13 21:25:19 183
原创 leetcode刷题记录-18. 4Sum
leetcode刷题记录-18. 4Sum 1.题目要求 Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum o...
2018-04-12 21:33:10 157
原创 leetcode刷题记录-121. Best Time to Buy and Sell Stock
leetcode刷题记录-121. Best Time to Buy and Sell Stock 1.题目要求 Description: Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to ...
2018-04-11 21:37:57 165
原创 leetcode刷题记录-202. Happy Number
leetcode刷题记录-202. Happy Number 1.题目要求 Write an algorithm to determine if a number is “happy”. A happy number is a number defined by the following process: Starting with any positive integer, re...
2018-04-09 17:45:36 301
原创 leetcode刷题记录-136. Single Number
leetcode刷题记录-136. Single Number 1.题目要求 Given an array of integers, every element appears twice except for one. Find that single one.. For example, given[1,2,3,2,1], Return 3. Note: Y...
2018-04-08 19:55:46 162
原创 leetcode刷题记录-119. Pascal's Triangle II
leetcode刷题记录-119. Pascal’s Triangle II 1.题目要求 Given an index k, return the kth row of the Pascal’s triangle. For example, given k = 3, Return [1,3,3,1]. Note: Could you optimize your a...
2018-03-25 20:39:57 141 1
原创 leetcode刷题记录-118. Pascal's Triangle
leetcode刷题记录-118. Pascal’s Triangle 1.题目要求 Given numRows, generate the first numRows of Pascal’s triangle. For example, given numRows = 5, Return [ [1], ...
2018-03-25 14:37:15 121
原创 leetcode刷题记录-88. Merge Sorted Array
leetcode刷题记录-88. Merge Sorted Array 1.题目要求 Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array Note: You may assume that nums1 has enough space (siz...
2018-03-24 18:10:08 122
原创 leetcode刷题记录-66. Plus One
leetcode刷题记录-66. Plus One 1.题目要求 Given a non-negative integer represented as a non-empty array of digits, plus one to the integer.You may assume the integer do not contain any leading zero, except...
2018-03-23 17:33:21 133
原创 leetcode刷题记录-28. Implement strStr()
leetcode刷题记录-28. Implement strStr() 1.题目要求 Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Example 1: Input: haystack = “hello”, ne...
2018-03-23 14:18:47 126
原创 leetcode刷题记录-53. Maximum Subarray
leetcode刷题记录-53. Maximum Subarray 题目要求:Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [-2,1,-3,4,-1,2,1,-5,4], ...
2018-03-22 15:34:52 198
原创 leetcode刷题记录-35. Search Insert Position
leetcode刷题记录-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 be if it were inserted in order....
2018-03-21 20:30:24 978
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人