
DP
鸡蛋豆腐仙子
从本科开始讨厌了单片机 晶体管 编程 c++5-6年后,发现技术就是我的真爱,再重新选择一次,我还是会选择当程序员。我现在觉得自己什么都不会,可是还是相信会变成别人仰望的大神。
展开
-
【刷题】Leetcode 300. Longest Increasing Subsequence
3 10 1 8 5 6 9 4 dp[]: 1 2 1 2 2 3 4 2public class Solution { public int lengthOfLIS(int[] nums) { if (nums.length == 0) { return 0; } int[] dp =...原创 2020-03-24 19:55:54 · 104 阅读 · 0 评论 -
【刷题】Leetcode 746. Min Cost Climbing Stairs
On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed).Once you pay the cost, you can either climb one or two steps. You need to find minimum cost to reach the top of t...原创 2019-12-09 15:55:11 · 86 阅读 · 0 评论 -
【刷题】Leetcode 91. Decode Ways
A message containing letters from A-Z is being encoded to numbers using the following mapping:‘A’ -> 1‘B’ -> 2…‘Z’ -> 26Given a non-empty string containing only digits, determine the tot...原创 2019-11-19 14:15:08 · 109 阅读 · 0 评论 -
【刷题】Leetcode 96. Unique Binary Search Trees
Example:Input: 3Output: 5Explanation:Given n = 3, there are a total of 5 unique BST’s:1 3 3 2 1\ / / / \ 3 2 1 1 3 2/ / ...原创 2019-11-18 18:45:32 · 85 阅读 · 0 评论