该文被密码保护。 阅读全文
posted @ 2022-02-25 12:11 阳光明媚的菲越 阅读(0) 评论(0) 推荐(0) 编辑
摘要: The key point of this problem is to find "key" of every words. Time complexity: O(n) How to find key of every string, we make every key as a string wi 阅读全文
posted @ 2022-02-25 11:15 阳光明媚的菲越 阅读(17) 评论(0) 推荐(0) 编辑
摘要: This problem requires add continues numbers, so the best solution is using prefix sum. Time complexity: O(n). class Solution { public boolean checkSub 阅读全文
posted @ 2022-02-25 10:42 阳光明媚的菲越 阅读(16) 评论(0) 推荐(0) 编辑
摘要: This is a similar problem with 398. Random Pick Index The following is my solution, which is easy to undersand: class Solution { int count = 0; Random 阅读全文
posted @ 2022-02-25 08:35 阳光明媚的菲越 阅读(27) 评论(0) 推荐(0) 编辑
摘要: This is a similar problem with: 382. Linked List Random Node The following is my solution, which is easy to understand: class Solution { Map<Integer,L 阅读全文
posted @ 2022-02-25 08:19 阳光明媚的菲越 阅读(22) 评论(0) 推荐(0) 编辑
摘要: Because the character can be duplicated, so we cannot use HashSet. This is easy if using bucket: public char findTheDifference(String s, String t) { i 阅读全文
posted @ 2022-02-25 06:26 阳光明媚的菲越 阅读(20) 评论(0) 推荐(0) 编辑
摘要: This problem can be solved by using two PriorityQueue(s), which is just the same solution as 295. Find Median from Data Stream. PriorityQueue<Integer> 阅读全文
posted @ 2022-02-25 03:41 阳光明媚的菲越 阅读(14) 评论(0) 推荐(0) 编辑