摘要:
1.剑指offer46--把数字翻译成字符串 class Solution { public int translateNum(int num) { List<Integer> container = new LinkedList<>(); while(num!=0){ container.add( 阅读全文
摘要:
1.剑指offer47 --礼物的最大价值 class Solution { public int maxValue(int[][] grid) { int m = grid.length, n = grid[0].length; int[][] dp = new int[m+1][n+1]; fo 阅读全文
摘要:
1.剑指offer 56 数组中数字出现的次数2 class Solution { public int singleNumber(int[] nums) { int[] cnt = new int[32]; int n = nums.length; for(int i = 0;i<n;i++){ 阅读全文
摘要:
1.面试题13. 机器人的运动范围 class Solution { //如果方向是上下左右则考虑深搜,如果方向是下和右则考虑dp //深度优先遍历 public int[] dx = new int[]{1,0,-1,0}; public int[] dy = new int[]{0,-1,0,1 阅读全文
摘要:
1.力扣373--和最小的k个数对 class Solution { class Node{ public int sum; public int i; public int j; Node(int sum, int i, int j){ this.i = i;this.j = j; this.su 阅读全文