CompletableFuture<Integer> ad = null; if (true) { ad = CompletableFuture.supplyAsync(() -> { try { TimeUnit.SECONDS.sleep(1); } catch (InterruptedExce ...
分类:
其他好文 时间:
2020-03-23 12:38:12
阅读次数:
288
Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer target. ...
分类:
其他好文 时间:
2020-03-22 19:30:38
阅读次数:
66
代码: public static void main(String[] args) { Integer[] mm = new Integer[] {14561,1264}; for (Integer item : mm) { item=45;//foreach 循环的变量是被transient 修 ...
分类:
其他好文 时间:
2020-03-22 17:27:25
阅读次数:
85
"Three Integers" 枚举$a,b$ 处理 $c$ 最小上界 $cc = cb (c / cb) + 1 cb;$ 最大上界$cc = cb (c / cb) + 0 cb;$ ...
分类:
其他好文 时间:
2020-03-22 12:21:22
阅读次数:
76
一:推荐使用 ThreadPoolExecutor 构造函数创建线程池 在《阿里巴巴 Java 开发手册》“并发处理”这一章节,明确指出线程资源必须通过线程池提供,不允许在应用中自行显示创建线程。 为什么呢? 使用线程池的好处是减少在创建和销毁线程上所消耗的时间以及系统资源开销,解决资源不足的问题。 ...
分类:
编程语言 时间:
2020-03-22 10:46:29
阅读次数:
86
LeetCode 1385. Find the Distance Value Between Two Arrays两个数组间的距离值【Easy】【Python】【暴力】 Problem "LeetCode" Given two integer arrays and , and the integer ...
分类:
编程语言 时间:
2020-03-22 10:27:21
阅读次数:
80
LeetCode 1387. Sort Integers by The Power Value将整数按权重排序【Medium】【Python】【排序】 Problem "LeetCode" The power of an integer is defined as the number of ste ...
分类:
编程语言 时间:
2020-03-22 10:23:56
阅读次数:
87
看到这个第一反应是当作字符去处理,于是就有了下面比较奇葩的代码哈哈哈,后面看到其他人一水的用运算解决,感觉时间和空间上会好很多,这里还是贴出来: class Solution { public int reverse(int x) { char[] chars=String.valueOf(x).t ...
分类:
其他好文 时间:
2020-03-22 01:41:43
阅读次数:
77
1.英文缩写 比如换行\n代表【+newline】;退格\b代表【+backspace】;回车\r代表【+return】。大家可以按照这种方法记住转义字符的含义 整数,整数英文为integer,简写做int整数,整数英文为integer,简写做int str代表字符串,全称为string,整数的英文 ...
分类:
编程语言 时间:
2020-03-22 01:08:35
阅读次数:
97
问题描述: 有一兔子,从出生后第3个月起每个月都生一兔子, 小兔子长到第三个月后每个月又生一对兔子 ,假如兔子都不死,问每个月的兔子总数为多少? 问题分析: 月份 兔子数 分析 1 1 f(1)=1 2 1 f(2)=1 3 1+1 f(3)=2 4 1+1 +1 f(4)=3 5 1+1+1 +1 ...
分类:
其他好文 时间:
2020-03-21 23:27:38
阅读次数:
88