摘要: java数组转list java java中数组转list使用Arrays.asList(T... a)方法。 示例: public class App { public static void main(String[] args) { List<String> stringA = Arrays. 阅读全文
posted @ 2017-10-11 16:59 流泉滴沙 阅读(326) 评论(0) 推荐(0)
摘要: Leetcode23:Merge k Sorted Listsleetcode java 1. 题目描述Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 把K个已经排序的链表合并到一起并返回它的链表头,分析并描述它的复杂度。 2. 解题思路这道题... 阅读全文
posted @ 2017-09-24 11:25 流泉滴沙 阅读(247) 评论(0) 推荐(0)
摘要: 1.题目描述 2.解题思路 3.代码实现 1.题目描述 Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. k is a positive integer 阅读全文
posted @ 2017-09-24 00:40 流泉滴沙 阅读(170) 评论(0) 推荐(0)
摘要: 3sum问题 leetcode java 1.问题描述 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 a 阅读全文
posted @ 2017-09-20 09:45 流泉滴沙 阅读(1106) 评论(0) 推荐(0)
摘要: Longest Common Prefix问题leetcodejava 1.问题描述Write a function to find the longest common prefix string amongst an array of strings.题目翻译:写一个函数,找到一个String数组中各个字符串的最长公共前缀。 2.解题思路这道题的难度是easy,确实解题思路也比较直观,首... 阅读全文
posted @ 2017-09-20 00:27 流泉滴沙 阅读(298) 评论(0) 推荐(0)
摘要: Roman to Integer问题leetcodejavatitle: 1.问题描述Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.{"","I","II","III","IV","V","VI","VII","VIII","IX... 阅读全文
posted @ 2017-09-13 17:18 流泉滴沙 阅读(158) 评论(0) 推荐(0)
摘要: Integer to Roman 问题leetcodejava 1.问题描述Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.题目翻译:把给定的一个整数翻译成罗马数字,这个整数限定在1到3999范围内。 2.解题思路这道题给的范围很... 阅读全文
posted @ 2017-09-13 16:47 流泉滴沙 阅读(152) 评论(0) 推荐(0)
摘要: Container With Most Water问题leetcodejavadp 1.问题描述Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpo... 阅读全文
posted @ 2017-09-13 16:23 流泉滴沙 阅读(169) 评论(0) 推荐(0)
摘要: Sudoku Solver问题leetcodejava递归 1. 问题描述Write a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated by the character '.'.You may assume that there will be only one uni... 阅读全文
posted @ 2017-09-10 00:00 流泉滴沙 阅读(137) 评论(0) 推荐(0)
摘要: Search in a Rotated Array问题 leetcode java 二分查找 1.问题描述 Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. ( 阅读全文
posted @ 2017-09-08 10:57 流泉滴沙 阅读(294) 评论(0) 推荐(0)