原创 [leetcode]Two Pointers-344. Reverse String

Write a function that takes a string as input and returns the string reversed. Example: Given s = "hello", return "ol

原创 [leetcode]Depth-first Search-695. Max Area of Island

Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-direction

原创 [leetcode]Backtracking-39. Combination Sum

Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C 

原创 [leetcode]Tree-669. Trim a Binary Search Tree

Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements l

原创 [leetcode] Hash Table-760. Find Anagram Mappings

Given two lists Aand B, and B is an anagram of A. B is an anagram of A means B is made by randomizing the order of

原创 [leetcode]Array-697. Degree of an Array

Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency o

原创 [leetcode]String-696. Count Binary Substrings

Give a string s, count the number of non-empty (contiguous) substrings that have the same number of 0's and 1's, and

原创 [leetcode]Dynamic Programming-121. Best Time to Buy and Sell Stock

Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to

原创 [leetcode]Math-413. Arithmetic Slices

A sequence of number is called arithmetic if it consists of at least three elements and if the difference between any

原创 [leetcode]Binary Search-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 it wo