代码改变世界

[LeetCode] 36. Valid Sudoku

2017-04-14 11:39 by amadis, 110 阅读, 0 推荐, 收藏, 编辑
摘要:Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku board could be partially filled, where empty cells are filled wit 阅读全文

[LeetCode] 35. Search Insert Position

2017-04-14 11:33 by amadis, 108 阅读, 0 推荐, 收藏, 编辑
摘要: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 or 阅读全文

[LeetCode] 34. Search for a Range

2017-04-14 11:32 by amadis, 95 阅读, 0 推荐, 收藏, 编辑
摘要:Given an array of integers sorted in ascending order, find the starting and ending position of a given target value. Your algorithm's runtime complexi 阅读全文

[LeetCode] 33. Search in Rotated Sorted Array

2017-04-14 11:29 by amadis, 114 阅读, 0 推荐, 收藏, 编辑
摘要:Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). You a 阅读全文

[LeetCode] 32. Longest Valid Parentheses

2017-04-14 11:27 by amadis, 113 阅读, 0 推荐, 收藏, 编辑
摘要:Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()", the lo 阅读全文

[LeetCode] 31. Next Permutation

2017-04-14 11:21 by amadis, 122 阅读, 0 推荐, 收藏, 编辑
摘要:Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possib 阅读全文

[LeetCode] 30. Substring with Concatenation of All Words

2017-04-01 01:23 by amadis, 138 阅读, 0 推荐, 收藏, 编辑
摘要:You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a conca 阅读全文

[LeetCode] 29. Divide Two Integers

2017-04-01 01:21 by amadis, 143 阅读, 0 推荐, 收藏, 编辑
摘要:Divide two integers without using multiplication, division and mod operator. If it is overflow, return MAX_INT. 阅读全文

[LeetCode] 28. Implement strStr()

2017-04-01 01:20 by amadis, 158 阅读, 0 推荐, 收藏, 编辑
摘要:Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. 阅读全文

[LeetCode] 27. Remove Element

2017-04-01 01:13 by amadis, 130 阅读, 0 推荐, 收藏, 编辑
摘要:Given an array and a value, remove all instances of that value in place and return the new length. Do not allocate extra space for another array, you 阅读全文