Fork me on GitHub
摘要: 就是找一个由1组成的边界 暴力解决 找到这个边框 算出一个由多少个数 下面解法真的妙 class Solution { public int largest1BorderedSquare(int[][] grid) { int ans = 0; int n = grid.length; int m 阅读全文
posted @ 2019-08-02 16:31 cznczai 阅读(292) 评论(0) 推荐(0) 编辑
摘要: 曼哈顿距离 class Solution { public String alphabetBoardPath(String target) { int x = 0, y = 0, nx = 0, ny = 0; StringBuffer ans = new StringBuffer(""); for 阅读全文
posted @ 2019-08-02 16:29 cznczai 阅读(242) 评论(0) 推荐(0) 编辑
摘要: class Solution { public int tribonacci(int n) { int T0 = 0; int T1 = 1; int T2 = 1; int arr[] = new int [40]; arr[0] = 0; arr[1] = 1; arr[2] = 1; for( 阅读全文
posted @ 2019-08-02 16:28 cznczai 阅读(222) 评论(0) 推荐(0) 编辑