2014年10月24日
摘要: 题目: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... 阅读全文
posted @ 2014-10-24 23:44 higerzhang 阅读(202) 评论(0) 推荐(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 wi... 阅读全文
posted @ 2014-10-24 12:21 higerzhang 阅读(310) 评论(0) 推荐(0) 编辑
  2014年10月23日
摘要: 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... 阅读全文
posted @ 2014-10-23 23:28 higerzhang 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 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 ord... 阅读全文
posted @ 2014-10-23 21:53 higerzhang 阅读(507) 评论(0) 推荐(0) 编辑
摘要: 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 t... 阅读全文
posted @ 2014-10-23 20:07 higerzhang 阅读(426) 评论(1) 推荐(0) 编辑
  2014年10月22日
摘要: Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the longest... 阅读全文
posted @ 2014-10-22 23:11 higerzhang 阅读(229) 评论(0) 推荐(0) 编辑
摘要: problem:Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not... 阅读全文
posted @ 2014-10-22 00:28 higerzhang 阅读(181) 评论(0) 推荐(0) 编辑
  2014年10月21日
摘要: problem:You are given a string,S, and a list of words,L, that are all of the same length. Find all starting indices of substring(s) in S that is a con... 阅读全文
posted @ 2014-10-21 23:19 higerzhang 阅读(302) 评论(0) 推荐(0) 编辑
摘要: Divide two integers without using multiplication, division and mod operator.分析:题目意思很容易理解,就是不用乘除法和模运算求来做除法,很容易想到的一个方法是一直做减法,然后计数,超时。在网上找到一种解法,利用位运算,意思是... 阅读全文
posted @ 2014-10-21 00:51 higerzhang 阅读(257) 评论(0) 推荐(0) 编辑
摘要: Implement strStr().Returns a pointer to the first occurrence of needle in haystack, ornullif needle is not part of haystack.就是判断haystack中是否有needle,如果包... 阅读全文
posted @ 2014-10-21 00:09 higerzhang 阅读(240) 评论(0) 推荐(0) 编辑