![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
小算法
砖业程序猿
fighting。。。。。。
展开
-
给定目标值,从数组中挑选出两个数字之和等于目标
public int[] twoSum(int[] nums, int target) { for (int i = 0; i < nums.length; i++) { for (int j = i + 1; j < nums.length; j++) { if (nums[j] == target - nums...原创 2018-03-08 11:47:23 · 875 阅读 · 0 评论 -
获取文件行数
private int getTotalLines(String filePath) throws IOException { FileReader in = new FileReader(filePath); LineNumberReader reader = new LineNumberReader(in); String strLine = r...原创 2018-03-08 12:52:20 · 1121 阅读 · 0 评论