摘要:
1.超时的,效率太低 1 public class Solution { 2 public int jump(int[] A) { 3 int len=A.length; 4 int d[]=new int[len]; 5 d[0]=0; 6 ... 阅读全文
摘要:
1。第一次觉得很简单,但是超时了 1 public class Solution { 2 public boolean canJump(int[] A) { 3 4 int len=A.length; 5 boolean b[]=new bo... 阅读全文
摘要:
1 public class Solution { 2 public int firstMissingPositive(int[] A) { 3 HashSet hash=new HashSet(); 4 int count=0; 5 int... 阅读全文
摘要:
参考https://oj.leetcode.com/problems/distinct-subsequences动态规划方程dp[i][j]=dp[i-1][j-1]+dp[i-1][j] (s(i)==t(i))dp[i][j]=dp[i-1][j];边界条件: iif(j==0) d[i][j]... 阅读全文
摘要:
1 public class Solution { 2 public String get(String a,String b) 3 { 4 5 if(a==""||b=="") return ""; 6 int len1=a.le... 阅读全文
摘要:
public class Solution { public int longestConsecutive(int[] num) { HashSet hash=new HashSet(); int max=1; for(int n:num) ... 阅读全文