摘要: Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates where the 阅读全文
posted @ 2019-02-07 03:38 Schwifty 阅读(113) 评论(0) 推荐(0)
摘要: Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note: The number of elements initialized in nums1 and num 阅读全文
posted @ 2019-02-07 03:02 Schwifty 阅读(113) 评论(0) 推荐(0)
摘要: Write a program to solve a Sudoku puzzle by filling the empty cells. A sudoku solution must satisfy all of the following rules: Empty cells are indica 阅读全文
posted @ 2019-02-06 14:05 Schwifty 阅读(139) 评论(0) 推荐(0)
摘要: Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'. '.' Matches any single character. '*' 阅读全文
posted @ 2019-02-06 13:40 Schwifty 阅读(109) 评论(0) 推荐(0)
摘要: 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 complexity sh 阅读全文
posted @ 2019-02-06 13:00 Schwifty 阅读(106) 评论(0) 推荐(0)
摘要: Given an array of strings, group anagrams together. Example: Note: All inputs will be in lowercase. The order of your output does not matter. class So 阅读全文
posted @ 2019-02-03 03:26 Schwifty 阅读(124) 评论(0) 推荐(0)
摘要: Given an unsorted integer array, find the smallest missing positive integer. Example 1: Example 2: Example 3: Note: Your algorithm should run in O(n) 阅读全文
posted @ 2019-02-03 01:00 Schwifty 阅读(124) 评论(0) 推荐(0)
摘要: 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 and is less than or equal to 阅读全文
posted @ 2019-02-02 06:29 Schwifty 阅读(147) 评论(0) 推荐(0)
摘要: Reverse a singly linked list. Example: Input: 1->2->3->4->5->NULL Output: 5->4->3->2->1->NULL Follow up: A linked list can be reversed either iterativ 阅读全文
posted @ 2019-02-01 12:56 Schwifty 阅读(336) 评论(0) 推荐(0)
摘要: 第一个方法,brute force,把所有elements收集到arraylist,然后sort,然后存到linked list。 public ListNode mergeKLists(ListNode[] lists) { List<Integer> l = new ArrayList<Inte 阅读全文
posted @ 2019-02-01 05:24 Schwifty 阅读(177) 评论(0) 推荐(0)