原创 leetcode_53. Maximum Subarray

題目: Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For exa

原创 leetcode_35. Search Insert Position

題目: Given a sorted array and a target value, return the index if the target is found. If not, return the index where i

原创 leetcode_67. Add Binary

題目: Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100".  用一想

原创 leetcode_38. Count and Say

題目: The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ... 1 is read

原创 leetcode_58. Length of Last Word

題目:Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last wo

原创 leetcode_70. Climbing Stairs

You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In

原创 leetcode_169. Majority Element

題目: Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊

原创 leetcode_9. Palindrome Number

題目: Determine whether an integer is a palindrome. Do this without extra space. 提示裏說了要看負數是不是。原來負數都按不是。於是很簡單,反過來然後看看和原來是不

原创 leetcode_83. Remove Duplicates from Sorted List

題目: Given a sorted linked list, delete all duplicates such that each element appear only once. For example, Given 1-

原创 leetcode_14. Longest Common Prefix

題目:Write a function to find the longest common prefix string amongst an array of strings. 挺簡單的,就是找到共同的最長前綴。我這個方法肯定浪費空間了

原创 leedcode_100. Same Tree

題目: Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equa

原创 leetcode_101. Symmetric Tree

題目: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this

原创 leetcod_516. Longest Palindromic Subsequence

題目: Given a string s, find the longest palindromic subsequence's length in s. You may assume that the maximum length

原创 leetcode_26. Remove Duplicates from Sorted Array

題目: Given a sorted array, remove the duplicates in place such that each element appear only once and return the new le

原创 leetcode_66. Plus One

題目: Given a non-negative integer represented as a non-empty array of digits, plus one to the integer. You may assume t