- 博客(10)
- 收藏
- 关注
原创 [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 where the candidate numbers sums to T. The same repeated number may be chosen
2018-01-13 09:40:56 153
原创 [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 "olleh".char* reverseString(char* s) { 2 assert(s != NULL); 3 int len= str
2018-01-13 09:38:43 141
原创 [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 would be if it were inserted in order. You may assume no duplicates in the array.
2018-01-13 09:36:36 139
原创 [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-directionally (horizontal or vertical.) You may assume all four edges of the grid are su
2018-01-13 09:35:00 154
原创 [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 lies in [L, R] (R >= L). You might need to change the root of the tree, so the r
2018-01-13 09:32:47 125
原创 [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 the elements in A. We want to find an index mapping P, from A to B. A mappin
2018-01-13 09:30:58 229
原创 [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 two consecutive elements is the same. For example, these are arithmetic sequence:
2018-01-13 09:28:35 168
原创 [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 all the 0's and all the 1's in these substrings are grouped consecutively. Su
2018-01-13 09:26:22 207
原创 [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 complete at most one transaction (ie, buy one and sell one share of the stock), d
2018-01-13 09:22:41 196
原创 [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 of any one of its elements. Your task is to find the smallest possible length o
2018-01-13 09:18:34 176
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人