- 博客(9)
- 资源 (2)
- 收藏
- 关注
原创 LeetCode7.3(Search a 2D Matrix)
Write an efficient algorithm that searches for a value in anmn matrix. is matrix has the followingproperties:• Integers in each row are sorted from left to right.• The first integer of each ro
2015-09-01 22:33:17 278
原创 LeetCode7.2(Search Insert Position)
Given a sorted array and a target value, return the index if the target is found. If not, return the indexwhere it would be if it were inserted in order.You may assume no duplicates in the array.
2015-09-01 22:31:09 248
原创 LeetCode7.1(Search for a Range)
Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm’s runtime complexity must be in the order of O(log n).If the target is not found in t
2015-09-01 22:28:05 256
原创 LeetCode6.7(Sort Colors)
Given an array with n objects colored red, white or blue, sort them so that objects of the same colorare adjacent, with the colors in the order red, white and blue.Here, we will use the integers 0
2015-09-01 22:24:49 210
原创 leetCode4.1.2(Longest Valid Parentheses)
Given a string containing just the characters ’(’ and ’)’, find the length of the longest valid (wellformed) parentheses substring.For ”(()”, the longest valid parentheses substring is ”()”, which h
2015-09-01 22:17:24 286
原创 leetCode4.1.1(Valid Parentheses)
描述Given a string containing just the characters ’(’, ’)’, ’{’, ’}’, ’[’ and ’]’, determine if theinput string is valid.The brackets must close in the correct order, ”()” and ”()[]” are all valid
2015-09-01 22:13:29 237
原创 leetCode3.3(String to Integer (atoi))
Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below andask yourself what are the possible input cas
2015-09-01 21:56:39 248
原创 LeetCode3.2(Implement strStr())
Implement strStr().Returns a pointer to the first occurrence of needle in haystack, or null if needle is not part of haystack这道题最好的方法自然是KMP算法,但是事实上,使用暴力穷举的方法也能获得相当不错的结果。public static int solutio
2015-09-01 21:46:03 295
原创 leetCode3.1(Valid Palindrome)
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoringcases.For example,”A man, a plan, a canal: Panama” is a palindrome.”race a car” is not a p
2015-09-01 21:43:09 250
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人