LeetCode
weixin_44117394
这个作者很懒,什么都没留下…
展开
-
Leetcode 532
题目:https://leetcode.com/problems/k-diff-pairs-in-an-array/Given an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array. Here a k-diff pair is defined ...原创 2018-12-20 04:01:46 · 153 阅读 · 0 评论 -
Leetcode86
https://leetcode.com/problems/partition-list/Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should preserve the orig...原创 2018-12-20 04:45:50 · 81 阅读 · 0 评论 -
LeetCode797
题目https://leetcode.com/problems/all-paths-from-source-to-target/Given a directed, acyclic graph of N nodes. Find all possible paths from node 0 to node N-1, and return them in any order.The graph ...原创 2018-12-21 02:01:29 · 120 阅读 · 0 评论 -
313. Super Ugly Number
网址:https://leetcode.com/problems/super-ugly-number/Write a program to find the nth super ugly number.Super ugly numbers are positive numbers whose all prime factors are in the given prime list prim...原创 2018-12-17 11:57:43 · 128 阅读 · 0 评论 -
LeetCode373
网址:https://leetcode.com/problems/find-k-pairs-with-smallest-sums/题目:You are given two integer arrays nums1 and nums2 sorted in ascending order and an integer k.Define a pair (u,v) which consists o...原创 2018-12-17 11:57:14 · 139 阅读 · 0 评论 -
LeetCode873
网址:https://leetcode.com/problems/length-of-longest-fibonacci-subsequence/题目:*A sequence X_1, X_2, …, X_n is fibonacci-like if:n >= 3X_i + X_{i+1} = X_{i+2} for all i + 2 <= nGiven a strict...原创 2018-12-18 04:53:52 · 189 阅读 · 0 评论 -
LeetCode905
https://leetcode.com/problems/sort-array-by-parity/solution1两个指针,相向而行public int[] sortArrayByParity(int[] A) { if (A == null || A.length < 2) { return A; } in...原创 2018-12-23 15:29:48 · 89 阅读 · 0 评论