Given a positive integer a, find the smallest positive integer b whose multiplication of each digit equals to a. If there is no answer or the answer i ...
分类:
其他好文 时间:
2017-11-24 15:09:15
阅读次数:
183
An ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the elements from smallest to large ...
分类:
其他好文 时间:
2017-11-21 01:03:32
阅读次数:
138
类似于find kth small element in sorted matrix, 另外数组是个好东西,在构造heap 的元素的时候 Some observations: For every numbers in nums1, its best partner(yields min sum) a ...
分类:
其他好文 时间:
2017-11-07 23:59:26
阅读次数:
365
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 from th ...
分类:
其他好文 时间:
2017-10-25 18:14:25
阅读次数:
170
Given a non-negative integer num represented as a string, remove k digits from the number so that the new number is the smallest possible. Note: The l ...
分类:
其他好文 时间:
2017-10-25 00:34:36
阅读次数:
151
Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matrix. Note that it is th ...
分类:
其他好文 时间:
2017-10-24 16:07:33
阅读次数:
100
Write a SQL query to delete all duplicate email entries in a table named Person, keeping only unique emails based on its smallest Id. For example, aft ...
分类:
其他好文 时间:
2017-10-24 13:18:46
阅读次数:
148
Note: This solution is combined with Trie + Generialized Abbreviation: 1. Since it looks for smallest one, we need persist a string to find minimum le ...
分类:
其他好文 时间:
2017-10-13 17:54:11
阅读次数:
144
两个有序的数组 nums1 和 nums2 维数分别为m,n。找所有数的中位数,复杂度 O(log (m+n)) 注意:奇偶个数,分治法求解,递归出口特殊处理。取Kth smallest数时,分治取mid=k/2和k-mid,避免奇数造成影响。 ...
分类:
其他好文 时间:
2017-10-09 19:34:58
阅读次数:
147
1. Use priority queue. Need to check whether one element has been double counted: 2 Binary search: For this kind of matrix, binary search should work ...
分类:
其他好文 时间:
2017-10-09 14:09:28
阅读次数:
126