2018年1月9日

LeetCode第[16]题(Java):3Sum Closest (和目标值最接近的三个数的和)——Medium

摘要: 题目难度:Medium 题目: Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the 阅读全文

posted @ 2018-01-09 23:27 清风吹斜阳 阅读(407) 评论(0) 推荐(0) 编辑

Java关于BufferedWriter.newline()换行的注意事项

摘要: 最近项目中需要导出文件,其实导出文件是一个挺简单的事情。但是却遇到了很奇怪的问题。 首先导出到文件需要用到 BufferedWriter。而换行则是通过 bw.newline() 方法,问题将出在 newline() 方法上面。 我们看一下 newline() api: 1 /** 2 * Writ 阅读全文

posted @ 2018-01-09 21:22 清风吹斜阳 阅读(7788) 评论(0) 推荐(0) 编辑

LeetCode第[15]题(Java):3Sum (三数之和为目标值)——Medium

摘要: 题目难度:Medium 题目: Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which g 阅读全文

posted @ 2018-01-09 00:17 清风吹斜阳 阅读(2537) 评论(1) 推荐(1) 编辑

导航