原创 Flatten Binary Tree to Linked List

/** * Definition for binary tree * public class TreeNode { * int val; * TreeNode left; * TreeNode righ

原创 Combination Sum

public class Solution { public ArrayList<Integer> l; public ArrayList<ArrayList<Integer>> l1; public ArrayL

原创 Distinct Subsequences

public class Solution { public int numDistinct(String S, String T) { // Start typing your Java solution bel

原创 Combination Sum II

public class Solution { public ArrayList<ArrayList<Integer>> ret; public ArrayList<Integer> cur; public Arr

原创 4Sum

public class Solution { public ArrayList<ArrayList<Integer>> fourSum(int[] num,int target) { // Start typin

原创 Jump Game II

public class Solution { public int jump(int[] A) { // Start typing your Java solution below // DO N

原创 Search a 2D Matrix

public class Solution { public boolean searchMatrix(int[][] matrix, int target) { // Start typing your Java

原创 Binary Tree Level Order Traversal II

/** * Definition for binary tree * public class TreeNode { * int val; * TreeNode left; * TreeNode righ

原创 3Sum Closest

import java.util.Arrays; public class Solution { public int min ; public int[] a; public int threeSumClose

原创 Convert Sorted List to Binary Search Tree

/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListN

原创 Binary Tree Maximum Path Sum

/** * Definition for binary tree * public class TreeNode { * int val; * TreeNode left; * TreeNode righ

原创 Pow(x, n)

public class Solution { public double pow(double x, int n) { // Start typing your Java solution below

原创 Letter Combinations of a Phone Number

import java.util.ArrayList; public class Solution { public int[] count; public char[] letter; ArrayList<St

原创 少有人走的路:心智成熟的旅程

《心理學研究》前言部分,解釋一般病人尋求心理治療的原因,他們都面臨一個共同的問題-------感覺自己不能夠對付或者改變現狀,因此產生恐懼,無助感和自我懷疑。大多數病人力不從心的根源,在於他們總想逃避自由,不能夠成爲他們的問題,他們生活承

原创 Minimum Depth of Binary Tree

public class Solution { public int minDepth(TreeNode root) { // Start typing your Java solution below