Given a node from a cyclic linked list which has been sorted, write a function to insert a value into the list such that it remains a cyclic sorted li ...
分类:
其他好文 时间:
2017-10-13 12:36:50
阅读次数:
125
好久没有做面试题了,感觉自己的编程能力又变弱了。 今天在lintCode上做了一道题,关于动态规划,比较有意思。 题意: 样例: 1.解题思路 这道题我们从动态规划的角度上分析。 首先,如果只有1个或者2个硬币的话,肯定是第一个玩家赢,这个是不可置疑的。 一个数组,我们从后往前分析(我们假设硬币的下 ...
分类:
编程语言 时间:
2017-10-11 21:49:29
阅读次数:
186
Given a binary tree, find the subtree with minimum sum. Return the root of the subtree. Notice LintCode will print the subtree which root is your retu ...
分类:
其他好文 时间:
2017-10-08 13:35:42
阅读次数:
178
Given a binary tree, find the subtree with maximum average. Return the root of the subtree. Notice LintCode will print the subtree which root is your ...
分类:
其他好文 时间:
2017-10-08 10:10:46
阅读次数:
329
lintcode;Check Sum of Square Numbers ...
分类:
其他好文 时间:
2017-10-05 20:55:48
阅读次数:
256
今天在lintCode做了一道面试题,非常的简单,利用常规的方法计算起来非常的简答,但是有意思的就是挑战项。我们先来看看题: 题意: 样例: 挑战: 常规的方法在这里就不展示,这里最主要的是展示Manacher算法。 1.Manacher算法 首先说明一下,Manacher算法能够使得在O(n)的时 ...
分类:
编程语言 时间:
2017-10-02 22:18:43
阅读次数:
267
给出字符串S和字符串T,计算S的不同的子序列中T出现的个数。 子序列字符串是原始字符串通过删除一些(或零个)产生的一个新的字符串,并且对剩下的字符的相对位置没有影响。(比如,“ACE”是“ABCDE”的子序列字符串,而“AEC”不是)。 样例 给出S = "rabbbit", T = "rabbit ...
分类:
其他好文 时间:
2017-09-30 09:55:32
阅读次数:
182
Segment Tree First, try to build the segment tree. lintcode suggest code: Currently recursion recommended. (For coding exercise, u can just start with ...
分类:
其他好文 时间:
2017-09-29 11:03:23
阅读次数:
110
Given a string that contains only digits 0-9 and a target value, return all possibilities to add binary operators (not unary) +, -, or * between the d ...
分类:
其他好文 时间:
2017-09-29 09:52:50
阅读次数:
172
Given a list of numbers, return all possible permutations. You can assume that there is no duplicate numbers in the list. Given a list of numbers, ret ...
分类:
其他好文 时间:
2017-09-28 10:07:25
阅读次数:
190