摘要:
/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ 阅读全文
摘要:
/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ 阅读全文
摘要:
class Solution { public int strToInt(String str) { int res =0; //用于数字溢出判断 int bndry = Integer.MAX_VALUE / 10; //sign标记 正负号 int i = 0, sign = 1,length 阅读全文
摘要:
//求 1+2+...+n ,要求不能使用乘除法、for、while、if、else、switch、case等关键字及条件判断语句(A?B:C)。class Solution { //定义res 表示计算结果 int res = 0; public int sumNums(int n) { // 当 阅读全文
摘要:
class Solution { public int maxProfit(int[] prices) { //minPrice表示 股票最低价购入 int minPrice = Integer.MAX_VALUE; //最大收益 int resultMax = 0 ; for(int i =1; 阅读全文