2013年10月13日

Longest Valid Parentheses

摘要: Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the longest... 阅读全文

posted @ 2013-10-13 09:07 Step-BY-Step 阅读(210) 评论(0) 推荐(0) 编辑

Sudoku Solver

摘要: Write a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated by the character'.'.You may assume that there will be on... 阅读全文

posted @ 2013-10-13 08:07 Step-BY-Step 阅读(332) 评论(0) 推荐(0) 编辑

Valid Sudoku

摘要: Determine if a Sudoku is valid, according to:Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are filled with ... 阅读全文

posted @ 2013-10-13 07:40 Step-BY-Step 阅读(123) 评论(0) 推荐(0) 编辑

Search in Rotated Sorted Array

摘要: Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).You are given a target value to search. If found in the array return its index, otherwise return -1.You may assume no duplicate exists in the array.两次二分,一次找到rotate的位置,一次找target。就是说 阅读全文

posted @ 2013-10-13 02:42 Step-BY-Step 阅读(251) 评论(0) 推荐(0) 编辑

导航