摘要:
class Solution { public int maxValue(int[][] grid) { int rows = grid.length; int cols = grid[0].length; //int dp[0][0] = grid[0][0]; for(int i=0;i<row 阅读全文
摘要:
//找规律法 class Solution { public int maxSubArray(int[] nums) { //全局变量标记是否输入无效 boolean isInvalidInput = false; if(nums == null || nums.length <= 0){ isIn 阅读全文
摘要:
class Solution { public int[] getLeastNumbers(int[] arr, int k) { if(k==0||arr.length<=0){ return new int[0]; } //默认是最小根堆,实现大根堆需要重写比较器 Queue<Integer> 阅读全文
摘要:
public class Solution { public int MoreThanHalfNum_Solution(int [] array) { //定义一个计数器count,存放众数的变量 card int card = 0; int count = 0; //找这个数字,一样就 计数加1, 阅读全文