1 | type Interval struct { |
1 best time to buy and sell stock
1 | func maxProfit(prices []int) int { |
2 best time to buy and sell stock II
1 | func maxProfit(prices []int) int { |
3 plus one
1 | func plusOne(digits []int) []int { |
4 pascal's triangle
1 | func generate(numRows int) [][]int { |
1 | func main() { |
5 pascal's triangle II
1 | func getRow(rowIndex int) []int { |
1 | func main() { |
6 array partition I
1 | func min(a, b int) int { |
7 find all numbers disappeared in an array
1 | func findDisappearedNumbers(nums []int) []int { |
1 | func findDisappearedNumbers(nums []int) []int { |
1 | func main() { |
8 two sum
1 | func twoSum(nums []int, target int) []int { |
1 | /** |
1 | type ListNode struct { |
9 two sum II - input array is sorted
1 | func twoSum(nums []int, target int) []int { |
10 remove duplicates from sorted array
1 | func removeDuplicates(nums []int) int { |
11 remove duplicates from sorted array II
1 | func removeDuplicates(nums []int) int { |
12 remove element
1 | func removeElement(nums []int, val int) int { |
13 majority element
1 | func majorityElement(nums []int) int { |
14 DONE shortest unsorted continuous subarray
- State "DONE" from "STARTED"
1 | func findUnsortedSubarray(nums []int) int { |
15 reshape the matrix
1 | func matrixReshape(nums [][]int, r int, c int) [][]int { |
16 search insert position
1 | func searchInsert(nums []int, target int) int { |
17 merge sorted array
1 | func merge(nums1 []int, m int, nums2 []int, n int) { |
18 maximum product of three numbers
1 | func max(a, b int) int { |
19 maximum average subarray I
1 | func findMaxAverage(nums []int, k int) float64 { |
20 move zeroes
1 | func moveZeroes(nums []int) { |
1 | func main() { |
21 can place flowers
1 | func canPlaceFlowers(flowerbed []int, n int) bool { |
22 contains duplicate
1 | func containsDuplicate(nums []int) bool { |
23 contains duplicate II
1 | func containsNearbyDuplicate(nums []int, k int) bool { |
24 contains duplicate III
1 | func abs(x int) int { |
25 k-diff pairs in an array
1 | func findPairs(nums []int, k int) int { |
26 best time to buy and sell stock II
1 | func maxProfit(prices []int) int { |
27 DONE maximum subarray
- State "DONE" from "WAITING"
1 | func maxSubArray(nums []int) int { |
28 missing number
1 | func missingNumber(nums []int) int { |
29 max consecutive ones
1 | func findMaxCntecutiveOnes(nums []int) int { |
30 rotate array
1 | func reverse(nums []int) { |
1 | func main() { |
31 find peak element
1 | func findPeakElement(nums []int) int { |
32 maximum product subarray
1 | func max(a, b int) int { |
1 | func main() { |
33 minimum size subarray sum
1 | func minSubArrayLen(s int, nums []int) int { |
1 | func main() { |
34 array nesting
1 | func arrayNesting(nums []int) int { |
1 | func main() { |
35 triangle
1 | func min(a, b int) int { |
36 subsets
1 | func subsets(nums []int) [][]int { |
37 subsets II
1 | type Item struct { |
38 search in rotated sorted array
1 | func search(nums []int, target int) int { |
39 search in rotated sorted array II
1 | func search(nums []int, target int) bool { |
40 search a 2d matrix
1 | func searchMatrix(matrix [][]int, target int) bool { |
41 sort colors
1 | func sortColors(nums []int) { |
42 set matrix zeroes
1 | func setZeroes(matrix [][]int) { |
43 unique paths
1 | func uniquePaths(m int, n int) int { |
44 unique paths II
1 | func uniquePathsWithObstacles(obstacleGrid [][]int) int { |
45 spiral matrix
1 | func spiralOrder(matrix [][]int) []int { |
46 spiral matrix II
1 | func generateMatrix(n int) [][]int { |
47 merge intervals
1 | func merge(intervals []Interval) []Interval { |
48 jump game
1 | class Solution { |
1 | func canJump(nums []int) bool { |
49 search for a range
1 | func searchRange(nums []int, target int) []int { |
50 rotate image
1 | func rotate(matrix [][]int) { |
51 valid triangle number
1 | func triangleNumber(nums []int) int { |
52 DONE task scheduler
- State "DONE" from "TODO"
1 | func leastInterval(tasks []byte, n int) int { |
1 | func leastInterval(tasks []byte, n int) int { |
1 | package main |
53 DONE word search
- State "DONE" from "TODO"
1 | struct Coord { |
58 DONE Image Smoother
- State "DONE" from "STARTED"
1 | func imageSmoother(M [][]int) [][]int { |
59 DONE Longest Continuous Increasing Subsequence
- State "DONE" from
1 | func findLengthOfLCIS(nums []int) int { |
60 DONE Non-decreasing Array
- State "DONE" from "STARTED"
1 | func checkPossibility(nums []int) bool { |
61 Find All Duplicates in an Array
1 | func findDuplicates(nums []int) []int { |
63 DONE Beautiful Arrangement II
- State "DONE" from "TODO"
1 | func constructArray(n int, k int) []int { |
1 | package main |
65 DONE Toeplitz Matrix
- State "DONE" from "TODO"
1 | func isToeplitzMatrix(matrix [][]int) bool { |
66 DONE Insert Delete GetRandom O(1) - Duplicates allowed
- State "DONE" from "TODO"
1 | package main |
67 DONE 第一个缺失的正数
- State "DONE" from "TODO"
1 | func firstMissingPositive(nums []int) int { |
Render by hexo-renderer-org with Emacs 25.3.2 (Org mode 8.2.10)