上一页 1 2 3 4 5 6 7 8 9 10 ··· 15 下一页
摘要: class Solution { public int coinChange(int[] coins, int amount) { int[] dp = new int[amount+1]; for(int i = 0; i < dp.length; i++) dp[i] = amount+1; / 阅读全文
posted @ 2022-02-12 22:30 明卿册 阅读(23) 评论(0) 推荐(0)
摘要: public String minWindow(String s, String t) { // 穷尽每个字符,看是否含有这个子字符串 // 枚举所有子串,并放入 // 从字串出发,用双指针枚举-> Map<Character, Integer> smap = new HashMap<>(); Ma 阅读全文
posted @ 2022-02-11 22:24 明卿册 阅读(35) 评论(0) 推荐(0)
摘要: public int[] intersection(int[] nums1, int[] nums2) { Set<Integer> set1 = new HashSet<>(), set2 = new HashSet<>(); for(int a: nums1) set1.add(a); List 阅读全文
posted @ 2022-02-11 21:47 明卿册 阅读(29) 评论(0) 推荐(0)
摘要: public int[] dailyTemperatures(int[] temperatures) { int len = temperatures.length; LinkedList<Integer>[] table = new LinkedList[101]; for(int i = 30; 阅读全文
posted @ 2022-02-10 22:53 明卿册 阅读(26) 评论(0) 推荐(0)
摘要: class Solution { public boolean isAnagram(String s, String t) { if (s.length() != t.length()) { return false; } int[] table = new int[26]; for (int i 阅读全文
posted @ 2022-02-10 22:30 明卿册 阅读(25) 评论(0) 推荐(0)
摘要: public List<Integer> inorderTraversal(TreeNode root) { List<Integer> res = new ArrayList<Integer>(); inorder(root, res); return res; } public void ino 阅读全文
posted @ 2022-02-09 22:14 明卿册 阅读(16) 评论(0) 推荐(0)
摘要: Map<Node, Node> map = new HashMap<>(); public Node copyRandomList(Node head) { if(head == null) return null; if(!map.containsKey(head)) { Node headNew 阅读全文
posted @ 2022-02-09 21:56 明卿册 阅读(27) 评论(0) 推荐(0)
摘要: class Solution { public List<String> topKFrequent(String[] words, int k) { Map<String, Integer> map = new HashMap<>(); for(String word: words) map.put 阅读全文
posted @ 2022-02-08 23:18 明卿册 阅读(23) 评论(0) 推荐(0)
摘要: private int capacity = 16; private int[] container; private boolean[] table; public MyHashMap() { this.container = new int[capacity]; this.table = new 阅读全文
posted @ 2022-02-08 23:04 明卿册 阅读(30) 评论(0) 推荐(0)
摘要: public int[] dailyTemperatures(int[] temperatures) { int len = temperatures.length; LinkedList<Integer>[] table = new LinkedList[101]; for(int i = 30; 阅读全文
posted @ 2022-02-07 22:28 明卿册 阅读(18) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 10 ··· 15 下一页