2015年3月6日
摘要: Follow upfor "Find Minimum in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Suppose a sort... 阅读全文
posted @ 2015-03-06 13:12 Chris兔的小佳佳 阅读(136) 评论(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).Find the minimum element.You m... 阅读全文
posted @ 2015-03-06 11:13 Chris兔的小佳佳 阅读(124) 评论(0) 推荐(0)
  2015年3月3日
摘要: Given an unsorted integer array, find the first missing positive integer.For example,Given[1,2,0]return3,and[3,4,-1,1]return2.Your algorithm should ru... 阅读全文
posted @ 2015-03-03 13:19 Chris兔的小佳佳 阅读(153) 评论(0) 推荐(0)
  2015年3月1日
摘要: 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 @ 2015-03-01 17:50 Chris兔的小佳佳 阅读(250) 评论(0) 推荐(0)
  2015年2月26日
摘要: The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11is read off as"tw... 阅读全文
posted @ 2015-02-26 22:51 Chris兔的小佳佳 阅读(193) 评论(0) 推荐(0)
  2015年2月25日
摘要: Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.保存最典型的,1,5,10,等,然后如果左边的数比右边的小,则减去左边的数,否则相加pa... 阅读全文
posted @ 2015-02-25 21:15 Chris兔的小佳佳 阅读(78) 评论(0) 推荐(0)
  2015年2月24日
摘要: Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.对于这道题,要把罗马数字中的几个特殊的数字保存到一张表中,如,4,5,9,10等,然后开... 阅读全文
posted @ 2015-02-24 12:56 Chris兔的小佳佳 阅读(161) 评论(0) 推荐(0)
  2015年2月3日
摘要: 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 @ 2015-02-03 22:54 Chris兔的小佳佳 阅读(115) 评论(0) 推荐(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... 阅读全文
posted @ 2015-02-03 19:32 Chris兔的小佳佳 阅读(112) 评论(0) 推荐(0)
  2015年2月2日
摘要: 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 @ 2015-02-02 22:14 Chris兔的小佳佳 阅读(125) 评论(0) 推荐(0)