原创 [leetCode] Find Minimum in Rotated Sorted Array I & II

Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7

原创 [leetCode] Compare Version Numbers

Compare two version numbers version1 and version1. If version1 > version2 return 1, if version1 < version2 return -1,

原创 [leetCode] Spiral Matrix II

Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. For example, Given n

原创 [leetCode] Word Search (new start. Let's go this)

Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequent

原创 [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

原创 [leetCode] Maximum Product Subarray

Find the contiguous subarray within an array (containing at least one number) which has the largest product. For exam

原创 [leetCode] Subsets II

Given a collection of integers that might contain duplicates, nums, return all possible subsets. Note: Elements in a

原创 [leetCode] Maximum Gap

Given an unsorted array, find the maximum difference between the successive elements in its sorted form. Try to solve

原创 [leetCode] Intersection of Two Linked Lists

Write a program to find the node at which the intersection of two singly linked lists begins. For example, the follow

原创 [leetCode] Subsets

Given a set of distinct integers, nums, return all possible subsets. Note: Elements in a subset must be in non-desce

原创 [LeetCode] Excel Sheet Column Title

Given a positive integer, return its corresponding column title as appear in an Excel sheet. For example: 1 -> A

原创 [leetCode] Merge Sorted Array

Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note: You may assume tha

原创 [leetCode] Different Ways to Add Parentheses

Given a string of numbers and operators, return all possible results from computing all the different possible ways t

原创 [leetCode] Power of Two

Given an integer, write a function to determine if it is a power of two. public class Solution { public boolean isP

原创 [leetCode] House Robber

You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed,