1.任务及要求 Roman Numeral Converter 将给定的数字转换成罗马数字。 所有返回的 罗马数字 都应该是大写形式。 如果你被难住了,记得使用 Read-Search-Ask尝试与他人结伴编程、编写你自己的代码。 这是一些对你有帮助的资源: Roman Numerals Array ...
分类:
其他好文 时间:
2020-03-03 14:39:14
阅读次数:
58
今天遇到一个我自己很少遇见的问题,我是用mybatis自动生成的entity,和dao以及mapper 。在我对数据库进行添加数据时发现mybatis报错了。Could not set property ‘id’ of ‘com.*.sys.entity’ with value ‘********’ ...
分类:
其他好文 时间:
2020-03-03 13:05:59
阅读次数:
265
Lists.partition public class testList { @Test public void test(){ List<Integer> numList = Lists.newArrayList(1, 2, 3, 4, 5, 6, 7, 8); List<List<Intege ...
分类:
其他好文 时间:
2020-03-02 20:46:46
阅读次数:
107
经典重温,冲冲冲。 Integer bitXor 解题思路:布尔代数。对于异或,从定义式出发,并使用「德摩根定律」变换: $$ \begin{align} A \oplus B &= \overline{A}B + \overline{B}A \\ &=\overline{(\overline{\o ...
分类:
移动开发 时间:
2020-03-02 14:24:39
阅读次数:
106
1、题目 Given a non-negative integer numRows, generate the first numRows of Pascal's triangle. In Pascal's triangle, each number is the sum of the two nu ...
分类:
其他好文 时间:
2020-03-01 23:19:06
阅读次数:
67
今天看服务端性能优化几个有用的地方记录下来: 问题代码: Map<Integer,Integer> map= new HashMap<Integer,Integer>(); for (int k=0;k<100000,k++){ map.put(k,k); } for(String key:map. ...
分类:
其他好文 时间:
2020-03-01 21:34:30
阅读次数:
67
写递归最重要的教训,不知道就会导致死循环的。 一般来说,DFS的递归边界即判断条件在第二层递归时才开始起作用,第一层不起作用,第二层的递归边界判断的是第一层数据处理的结果。切记切记!!! 所以在写选择分支时,要处理的是当前参数,而不是下一层递归的参数, 所以在主函数中调用DFS时,填入的参数一般都是 ...
分类:
其他好文 时间:
2020-03-01 19:40:53
阅读次数:
65
Array LeetCode Given an integer array of size n, find all elements that appear more than ? n/3 ? times. The algorithm should run in linear time and i.... ...
分类:
其他好文 时间:
2020-03-01 14:18:51
阅读次数:
71
译自:https://ruslanspivak.com/lsbasi part2/ (已获作者授权) 在他们的著作《有效思维的五个要素》(The 5 Elements of Effective Thinking)中,Burger和Starbird分享了一个故事,讲述了他们如何观察国际知名的小号演奏家 ...
分类:
其他好文 时间:
2020-03-01 12:36:46
阅读次数:
59
什么是锁 在单线程情况下,看下面代码: public class Test { // 计数器 private Integer count = 0; // 累加操作 public void addOne() { count += 1; } // 获取计算器的值 public Integer getCo ...
分类:
编程语言 时间:
2020-03-01 12:17:32
阅读次数:
66