Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Below is one possible representati ...
分类:
其他好文 时间:
2018-10-16 10:16:48
阅读次数:
174
Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path betwe ...
分类:
其他好文 时间:
2018-10-11 13:41:53
阅读次数:
156
Given the root node of a binary search tree (BST) and a value. You need to find the node in the BST that the node's value equals the given value. Retu ...
分类:
编程语言 时间:
2018-10-06 22:08:54
阅读次数:
226
Codeforces 1060 b You are given a positive integer nn. Let S(x)S(x) be sum of digits in base 10 representation of xx, for example, S(123)=1+2+3=6S(123 ...
分类:
其他好文 时间:
2018-10-06 11:52:23
阅读次数:
172
Given a non-empty array of digits representing a non-negative integer, plus one to the integer. The digits are stored such that the most significant d ...
分类:
编程语言 时间:
2018-10-05 17:19:58
阅读次数:
157
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. A mapping of digit to le ...
分类:
其他好文 时间:
2018-10-04 10:00:48
阅读次数:
133
The Unique MST http://poj.org/problem?id=1679 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 36744 Accepted: 13395 Description Given a con ...
分类:
其他好文 时间:
2018-10-04 09:26:31
阅读次数:
160
今天博主立下一个flag,必须要开始好好解决DP问题!!LC现在DP系列有117题,现在从易到难的顺序重走这117之路。 今天坐在Victoria coffee 里面从第一个最简单的paint house问题解决开始。 ps:这里都是博主自己做题时的思考过程,不是大神讲解,欢迎指正缺陷和错误。 Pa ...
分类:
其他好文 时间:
2018-09-30 14:56:14
阅读次数:
153
Write a program that outputs the string representation of numbers from 1 to n. But for multiples of three it should output “Fizz” instead of the numbe ...
分类:
其他好文 时间:
2018-09-30 13:02:36
阅读次数:
170
We have two special characters. The first character can be represented by one bit 0. The second character can be represented by two bits (10 or 11). N ...
分类:
编程语言 时间:
2018-09-29 23:58:12
阅读次数:
339