摘要:
class Solution { public int minFallingPathSum(int[][] A) { if(A== null|| A.length==0 || A[0].length ==0 ){ return 0; } int n = A.length ;... 阅读全文
摘要:
class Solution { public int minPathSum(int[][] grid) { //border scenario int i = grid.length; int j = grid[0].length; ... 阅读全文
摘要:
1138. Alphabet Board Path On an alphabet board, we start at position (0, 0), corresponding to character board[0][0]. Here, board = ["abcde", "fghij", 阅读全文
摘要:
class Solution { public int tribonacci(int n) { if(n ==0){ return 0; } if (n ==1){ return 1; } ... 阅读全文
摘要:
class Solution { public int maxSubArray(int[] nums) { // border examinine if (nums.length ==0 || nums==null){ return 0; } if(num... 阅读全文
摘要:
class Solution { public int climbStairs(int n) { if (n ==0) return 0; if (n ==1){ return 1; } if(n ==2){ ... 阅读全文
摘要:
class Solution { public int rob(int[] nums) { if(nums.lengthb? a: b; } } 阅读全文
摘要:
import java.util.*; class Solution { public boolean divisorGame(int N) { if (N ==0){ return false; } Map st = new HashMap(); ... 阅读全文
摘要:
Given an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy of th 阅读全文
摘要:
Given an array A of positive lengths, return the largest perimeter of a triangle with non-zero area, formed from 3 of these lengths. If it is impossib 阅读全文