摘要:
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. 阅读全文
摘要:
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. 阅读全文
摘要:
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 阅读全文
摘要:
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, 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文