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

浙公网安备 33010602011771号