摘要:
Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note: The number of elements initialized in nums1 and num 阅读全文
posted @ 2018-12-02 18:52
fatttcat
阅读(116)
评论(0)
推荐(0)
摘要:
Given a non-negative index k where k ≤ 33, return the kth index row of the Pascal's triangle. Note that the row index starts from 0. In Pascal's trian 阅读全文
posted @ 2018-12-02 18:32
fatttcat
阅读(110)
评论(0)
推荐(0)
摘要:
Given a non-negative integer numRows, generate the first numRows of Pascal's triangle. In Pascal's triangle, each number is the sum of the two numbers 阅读全文
posted @ 2018-12-02 17:30
fatttcat
阅读(117)
评论(0)
推荐(0)
摘要:
Given a non-empty array of digits representing a non-negative integer, plus one to the integer. The digits are stored such that the most significant d 阅读全文
posted @ 2018-12-02 15:46
fatttcat
阅读(129)
评论(0)
推荐(0)
摘要:
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. Example: Note: 用 阅读全文
posted @ 2018-12-02 15:16
fatttcat
阅读(103)
评论(0)
推荐(0)
摘要:
An array is monotonic if it is either monotone increasing or monotone decreasing. An array A is monotone increasing if for all i <= j, A[i] <= A[j]. A 阅读全文
posted @ 2018-12-02 15:02
fatttcat
阅读(99)
评论(0)
推荐(0)
摘要:
用binary search 如果A[mid] < A[mid+1],说明peak在mid右侧,l = mid + 1;否则说明peak在mid右侧,r = mid 时间:O(N),空间:O(1) 阅读全文
posted @ 2018-12-02 12:10
fatttcat
阅读(113)
评论(0)
推荐(0)
摘要:
Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The function 阅读全文
posted @ 2018-12-02 10:02
fatttcat
阅读(130)
评论(0)
推荐(0)
摘要:
Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to k. Example 1: Note: 解法:hash 阅读全文
posted @ 2018-12-02 09:56
fatttcat
阅读(119)
评论(0)
推荐(0)
摘要:
Given two sparse matrices A and B, return the result of AB. You may assume that A's column number is equal to B's row number. Example: Input: A = [ [ 阅读全文
posted @ 2018-12-02 04:53
fatttcat
阅读(177)
评论(0)
推荐(0)
浙公网安备 33010602011771号