- 博客(6)
- 收藏
- 关注
原创 list 中每个一个间隔输出一个元素
def frange(start, stop, increment): x = start while x < stop: yield x x += increment
2014-03-21 15:47:32 10487
原创 Minimum number of jumps to reach end
def outList(arr): arraySize = len(arr) auxList = [0 for x in range(arraySize)] auxList[0] = 1 for curIdx in range(1, arraySize): minSteps = curIdx+1;
2014-03-20 14:59:33 735
原创 leetcode: LUR Cache
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set. get(key) - Get the value (will always be positive) of the key if t
2014-03-18 16:48:24 760
原创 leetcode: Sum Root to Leaf Numbers
Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3 which represents the number 123. Find the total sum
2014-03-18 15:33:46 382
原创 longest not repeating substring
class Solution { public: int min(int a, int b) { if (a >= b) return b; else return a; } int lengthOfLongestSubstring(string s) {
2014-03-17 16:00:27 403
原创 Sort a list with down pointer
Given a link list with right pointers and each element of the list has a down link contains another link list with down pointers as: 5 -> 7 -> 9 -> 18 | | | | 10 6 14 20 | |
2014-03-17 14:09:32 736
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人