上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 17 下一页
该文被密码保护。 阅读全文
posted @ 2022-03-08 05:17 阳光明媚的菲越 阅读(0) 评论(0) 推荐(0) 编辑
摘要: This is a easier common grap and look for shortest path problem, time complexity: O(m*n): class Solution { public int getFood(char[][] grid) { int m = 阅读全文
posted @ 2022-03-05 15:02 阳光明媚的菲越 阅读(25) 评论(0) 推荐(0) 编辑
摘要: This is graph and look for the shortest path, so BFS should be solution. But how to handle K? We can look K as a parameter of every node. My first sol 阅读全文
posted @ 2022-03-05 14:29 阳光明媚的菲越 阅读(37) 评论(0) 推荐(0) 编辑
摘要: This is a graph problem, and the problem try to find the shortest path. So BFS is just right solution, the following is my first solution. It works bu 阅读全文
posted @ 2022-03-05 09:03 阳光明媚的菲越 阅读(29) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
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 阳光明媚的菲越 阅读(13) 评论(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 阳光明媚的菲越 阅读(11) 评论(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 阳光明媚的菲越 阅读(23) 评论(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 阳光明媚的菲越 阅读(19) 评论(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) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 17 下一页