Initial commit
Is Balanced Tree
3 SUM

Given an array S of n integers, are there elements a, b, c in S such
that a + b + c = 0? Find all unique triplets in the array which gives
the sum of zero.

Note:

Elements in a triplet (a,b,c) must be in non-descending order. (ie, a ?
b ? c)
The solution set must not contain duplicate triplets.

For example, given array S = {-1 0 1 2 -1 -4},

A solution set is:
(-1, 0, 1)
(-1, -1, 2)
3 Sum Closest

Given an array S of n integers, find three integers in S such that the
sum is closest to a given number, target. Return the sum of the three
integers. You may assume that each input would have exactly one
solution.

For example, given array S = {-1 2 1 -4}, and target = 1.

The sum that is closest to the target is 2. (-1 + 2 + 1 = 2).
Add Binary
Add Two Numbers

You are given two linked lists representing two non-negative numbers.
The digits are stored in reverse order and each of their nodes contain a
single digit. Add the two numbers and return it as a linked list.

Input: (2 -> 4 -> 3) + (5 -> 6 -> 4)
Output: 7 -> 0 -> 8
Anagrams

Given an array of strings, return all groups of strings that are
anagrams.

Note: All inputs will be in lower-case.
Two Sum

Given an array of integers, find two numbers such that they add up to a
specific target number.

The function twoSum should return indices of the two numbers such that
they add up to the target, where index1 must be less than index2. Please
note that your returned answers (both index1 and index2) are not
zero-based.

You may assume that each input would have exactly one solution.

Input: numbers={2, 7, 11, 15}, target=9
Output: index1=1, index2=2
Path Sum(Iterator)

Given a binary tree and a sum, determine if the tree has a root-to-leaf
path such that adding up all the values along the path equals the given
sum.
For example:
Given the below binary tree and sum = 22,

5
/ \
4   8
/   / \
11  13  4
/  \      \
7    2      1

return true, as there exist a root-to-leaf path 5->4->11->2 which sum is
22.
Create PreorderTraversalSolution.java
LeetCode
Merge branch 'master' of https://github.com/sihaiyang0215/leetcode
Merge branch 'master' of https://github.com/sihaiyang0215/leetcode