摘要:
机器环境:centos7.0 安装lua-5.3.4 ##下载压缩包 wget http://www.lua.org/ftp/lua-5.3.4.tar.gz ##解压 tar -zxvf lua-5.3.4.tar.gz ##进入安装目录 cd lua-5.3.4 ## make linux te 阅读全文
摘要:
public int maxProfit(int[] prices) { int max = 0 , min = Integer.MAX_VALUE; for(int num : prices) { max = Math.max(max,num - min); min = Math.min(min, 阅读全文
摘要:
I. 数组中数字出现的次数 解法一: 哈希表 public int[] singleNumbers(int[] nums) { int[] ans = new int[2]; Map<Integer,Boolean> map = new HashMap<>(); for(int i = 0 ; i 阅读全文
摘要:
public int maxSubArray(int[] nums) { int n = nums.length; int[] dp = new int[n+1]; int ans = Integer.MIN_VALUE; for(int i = 1 ; i<= n ; i++) { dp[i] = 阅读全文