摘要:
单词搜索(079) class Solution { int m, n; public boolean exist(char[][] board, String word) { m = board.length; n = board[0].length; char[] words = word.to 阅读全文
摘要:
全排列(046) class Solution { List<List<Integer>> res = new ArrayList<>(); public List<List<Integer>> permute(int[] nums) { int n = nums.length; List<Inte 阅读全文
摘要:
岛屿数量(200) class Solution { public int numIslands(char[][] grid) { int res = 0; int m = grid.length; int n = grid[0].length; for (int i = 0; i < m ; i+ 阅读全文
摘要:
二叉树的右视图(199) class Solution { List<Integer> res = new ArrayList<>(); public List<Integer> rightSideView(TreeNode root) { dfs(root, 0); return res; } p 阅读全文
摘要:
二叉树的中序队列(094) 先看代码 class Solution { public List<Integer> inorderTraversal(TreeNode root) { List<Integer> res = new ArrayList<>(); Stack<TreeNode> stac 阅读全文