题目描述: LeetCode 483. Smallest Good Base For an integer n, we call k>=2 a good base of n, if all digits of n base k are 1. Now given a string representi ...
分类:
其他好文 时间:
2017-12-03 17:17:25
阅读次数:
365
题目描述:给定一个由时间字符组成的列表,找出任意两个时间之间最小的差值。 思路: 1. 把给定的链表排序,并且在排序的同时把60进制的时间转化成十进制整数; 2. 遍历排序的数组,求出两个相邻值之间的差值; 3. 求出首尾两个值之间的差值。 python class Solution(object) ...
分类:
编程语言 时间:
2017-12-03 13:59:53
阅读次数:
202
Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note: You may assume k is always valid, 1 ≤ k ≤ BST's ...
分类:
其他好文 时间:
2017-12-03 11:41:35
阅读次数:
159
题目: 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 l ...
分类:
编程语言 时间:
2017-12-02 16:22:40
阅读次数:
157
是不是dp[i][j]是到a[i]和b[j]的最小diff之和 那么dp[i][j] = min( dp[i-1][j-1]+math.abs(a[i]-b[j]), dp[i][j-1]) 第一个是肯定包含b[j]的,第二个是肯定不包含b[j]的, ...
分类:
其他好文 时间:
2017-12-02 14:08:59
阅读次数:
129
Given an array of integers, find out whether there are two distinct indices i and j in the array such that the absolute difference between nums[i] and ...
分类:
其他好文 时间:
2017-12-02 11:05:27
阅读次数:
100
[MY NOTE] Translate Source:http://www.dotnettricks.com/learn/webapi/difference-between-wcf-and-web-api-and-wcf-rest-and-web-service Web Service 1.基于SO ...
[MY NOTE] Translate Source:http://www.dotnettricks.com/learn/webapi/difference-between-wcf-and-web-api-and-wcf-rest-and-web-service Web Service 1.基于SO ...
An image is represented by a binary matrix with 0 as a white pixel and 1 as a black pixel. The black pixels are connected, i.e., there is only one bla ...
分类:
其他好文 时间:
2017-11-26 16:00:31
阅读次数:
172
1.冲突后和远程仓库的文件进行比对的时候,善于用上图所示的按钮,会提高效率 copy all-nonconflicting changes from right to left next difference、 copy current changes from right to left 解决冲突 ...
分类:
其他好文 时间:
2017-11-26 15:54:21
阅读次数:
233