上一页 1 2 3 4 5 6 7 8 9 10 ··· 17 下一页
摘要: Instead of counting levels form root to leaves, this problem is counting levels from leaves to root. That is the leaves has the height of 1, and the r 阅读全文
posted @ 2022-03-11 04:13 阳光明媚的菲越 阅读(8) 评论(0) 推荐(0) 编辑
摘要: The most simple version: class Solution { public boolean isToeplitzMatrix(int[][] matrix) { if(matrix==null||matrix[0].length==0) return true; int m = 阅读全文
posted @ 2022-03-10 01:45 阳光明媚的菲越 阅读(14) 评论(0) 推荐(0) 编辑
摘要: This is a hard problem. If I got this problem the first time when I was interviewed, I would not be able to solve it. public int[] findDiagonalOrder(i 阅读全文
posted @ 2022-03-09 14:23 阳光明媚的菲越 阅读(18) 评论(0) 推荐(0) 编辑
摘要: This problem is different with 542. 01 Matrix and 286. Walls and Gates. 542 and 286 is once get the shortest path from one of the targets, then the ce 阅读全文
posted @ 2022-03-09 11:50 阳光明媚的菲越 阅读(25) 评论(0) 推荐(0) 编辑
摘要: The solution of this issue is as same as 542. 01 Matrix class Solution { int m, n; private int[][] dirs ={{-1,0},{1,0},{0,-1},{0,1}}; public void wall 阅读全文
posted @ 2022-03-09 05:18 阳光明媚的菲越 阅读(22) 评论(0) 推荐(0) 编辑
摘要: If you could find the secret of image rotate, then this would be a simple problem. 1. If you want to rotate the image by 90 degrees clockwise,then rev 阅读全文
posted @ 2022-03-09 03:57 阳光明媚的菲越 阅读(19) 评论(0) 推荐(0) 编辑
摘要: This problem need to solve mutiple Strings, so we use a Trie to store all strings, and then do DFS. Time complexity: O(m*n*3L), L is the maximum of th 阅读全文
posted @ 2022-03-08 15:28 阳光明媚的菲越 阅读(33) 评论(0) 推荐(0) 编辑
摘要: Although this is a matrix problem, but it cannot be done by BFS, following is my solution, but it doesn't work when the test case is: [["A","B","C","E 阅读全文
posted @ 2022-03-08 12:56 阳光明媚的菲越 阅读(38) 评论(0) 推荐(0) 编辑
摘要: If you know how to solve 827. Making A Large Island, then this one is a piece of cake: class Solution { private int res =0; int m,n; public int numIsl 阅读全文
posted @ 2022-03-08 08:33 阳光明媚的菲越 阅读(22) 评论(0) 推荐(0) 编辑
摘要: This problem is based on 695. Max Area of Island 1. Create a islands matrix, if a cell in grid is 1, there will be a corresponding island number in is 阅读全文
posted @ 2022-03-08 08:16 阳光明媚的菲越 阅读(26) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 17 下一页