摘要:
Given an unsorted array nums, reorder it in-place such that nums[0] <= nums[1] >= nums[2] <= nums[3].... Notice Please complete the problem in-place. 阅读全文
posted @ 2016-07-12 23:56
北叶青藤
阅读(281)
评论(0)
推荐(0)
摘要:
Check if two binary trees are identical. Identical means the two binary trees have the same structure and every identical position has the same value. 阅读全文
posted @ 2016-07-12 07:23
北叶青藤
阅读(257)
评论(0)
推荐(0)
摘要:
Given a binary tree, return all root-to-leaf paths. Example Given the following binary tree: 1 / \ 2 3 \ 5 All root-to-leaf paths are: [ "1->2->5", "1 阅读全文
posted @ 2016-07-12 07:21
北叶青藤
阅读(176)
评论(0)
推荐(0)
摘要:
Write an algorithm to determine if a number is happy. A happy number is a number defined by the following process: Starting with any positive integer, 阅读全文
posted @ 2016-07-12 06:49
北叶青藤
阅读(433)
评论(0)
推荐(0)
摘要:
Factory is a design pattern in common usage. Implement a ShapeFactory that can generate correct shape. You can assume that we have only tree different 阅读全文
posted @ 2016-07-12 06:37
北叶青藤
阅读(541)
评论(0)
推荐(0)
摘要:
A message containing letters from A-Z is being encoded to numbers using the following mapping: 'A' -> 1 'B' -> 2 ... 'Z' -> 26 Given an encoded messag 阅读全文
posted @ 2016-07-12 02:45
北叶青藤
阅读(229)
评论(0)
推荐(0)
摘要:
Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. Example Given n = 12, retu 阅读全文
posted @ 2016-07-12 02:04
北叶青藤
阅读(250)
评论(0)
推荐(0)
摘要:
House Robber You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constrain 阅读全文
posted @ 2016-07-12 00:26
北叶青藤
阅读(231)
评论(0)
推荐(0)

浙公网安备 33010602011771号