上一页 1 ··· 4 5 6 7 8

2018年1月15日

LeetCode第[18]题(Java):4Sum (四个数的和为目标值)——Medium

摘要: 题目难度:Medium 题目: Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets i 阅读全文

posted @ 2018-01-15 23:31 清风吹斜阳 阅读(1073) 评论(0) 推荐(0) 编辑

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) 编辑

2018年1月7日

LeetCode第[11]题(Java):Container With Most Water (数组容器盛水)——Medium

摘要: 题目难度:Medium Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that t 阅读全文

posted @ 2018-01-07 22:58 清风吹斜阳 阅读(576) 评论(0) 推荐(0) 编辑

LeetCode第[4]题(Java):Median of Two Sorted Arrays (俩已排序数组求中位数)——HARD

摘要: 题目难度:hard There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time com 阅读全文

posted @ 2018-01-07 21:03 清风吹斜阳 阅读(588) 评论(4) 推荐(0) 编辑

2018年1月6日

LeetCode第[1]题(Java):Two Sum (俩数和为目标数的下标)——EASY

摘要: 题目: Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would hav 阅读全文

posted @ 2018-01-06 21:08 清风吹斜阳 阅读(2241) 评论(0) 推荐(1) 编辑

上一页 1 ··· 4 5 6 7 8

导航