
題目:backpack I (每個物品取一次,求最多能裝多少物品) Given n items with size Ai, an integer m denotes the ...
題型 1. 排序:兩個或多個array(一般是sorted)按照某規則排序 88. Merge Sorted Array283. Move Zeroes56. Merge I...
層遍歷問題 問題:Binary Tree Level Order Traversal Given a binary tree, return the level order ...
問題: Next Greater Element I You are given two arrays (without duplicates) nums1 and nums...
題目:Add Two Numbers You are given two non-empty linked lists representing two non-negati...
1. 加法: 問題: Calculate the sum of two integers a and b, but you are not allowed to use th...
題目 Given an array of n integers where n > 1, nums, return an array output such that out...
題目:Contains Duplicate Given an array of integers, find if the array contains any duplic...
問題:Reverse Linked List Reverse a singly linked list. Input: 鏈表頭結點 :: ListNode Output: 翻...
題目 Given an integer n, generate all structurally unique BST's (binary search trees) tha...
接觸DP最早的應該就是這道題了吧,翻了翻leetcode submission發現最早的是在一年前... 而且是最基礎的DP解法。在膜拜了大神們用矩陣甚至直接上斐波那契數列公...