Given an array `A` of integers, for each integer `A[i]` we may choose any `x` with `-K <= x <= K`, and add `x` to `A[i]`. After this process ...
You haveklists of sorted integers in ascending order. Find thesmallestrange that includes at least one number from each of theklists. We define the range a,b is smaller than range c,d ifb a lt d cora ...
2017-07-18 13:26 4 7059 推荐指数:
Given an array `A` of integers, for each integer `A[i]` we may choose any `x` with `-K <= x <= K`, and add `x` to `A[i]`. After this process ...
Given an array `A` of integers, for each integer `A[i]` we need to choose either `x = -K` or `x = K`, and add `x` to `A[i] (only once)`. After ...
Given a positive integer K, you need to find the length of the smallest positive integer N such that N is divisible by K, and N only contains ...
You are given two integer arrays nums1 and nums2 sorted in ascending order and an integer k. Define a pair (u,v) which consists of one element ...
的表头元素取出来,建立一个小顶堆,因为k个链表中都排好序了,因此每次取堆顶的元素就是k个链表中的最小值 ...
题目链接 Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 合并k个有序的链表,我们假设每个链表的平均长度是n。这一题需要用到合并两个有序的链表子 ...
Given a non-empty array of integers, return the k most frequent elements. Example 1: Example 2: Note: You may assume k is always ...
Given a sorted array, two integers k and x, find the k closest elements to x in the array. The result should also be sorted in ascending order. ...