摘要:
class Solution { public int rob(int[] nums) { if(nums.length==0) return 0; if(nums.length==1) return nums[0]; return Math.max(rob1(nums, 0, nums.le... 阅读全文
摘要:
class Solution { class Trie{ public Trie[] children=new Trie[26]; public boolean isWord=false; public boolean added=false; public void insert(String word) { ... 阅读全文
摘要:
class WordDictionary { private WordDictionary[] children=new WordDictionary[26]; boolean isWord=false; /** Initialize your data structure here. */ public WordDictionary() {... 阅读全文
摘要:
class Solution { public int[] findOrder(int numCourses, int[][] prerequisites) { int[] indegrees=new int[numCourses]; int[][] graph=new int[numCourses][numCourses]; ... 阅读全文
摘要:
class Solution { public int minSubArrayLen(int s, int[] nums) { int i=0; int j=0; int len= Integer.MAX_VALUE; int sum=0; while(j=s) { ... 阅读全文
摘要:
class Trie { Trie[] children=new Trie[26]; boolean isWord=false; /** Initialize your data structure here. */ public Trie() { } /** Inserts a word into... 阅读全文
摘要:
class Solution { public boolean canFinish(int numCourses, int[][] prerequisites) { int[] indegrees=new int[numCourses]; int[][] graph=new int[numCourses][numCourses]; for(... 阅读全文