2014年2月28日

2-28

摘要: 今天也只刷了4道题。1.需要注意string不是char*,直接在对应位置赋值最终不会正确返回string2.求区间的题比求位置的题需要多注意一下,返回的位置是靠前还是靠后。 阅读全文

posted @ 2014-02-28 20:01 pengyu2003 阅读(81) 评论(0) 推荐(0) 编辑

Unique Paths

摘要: A robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked 'Finish' in the diagram below).How many possible uni 阅读全文

posted @ 2014-02-28 19:57 pengyu2003 阅读(106) 评论(0) 推荐(0) 编辑

Count and Say

摘要: 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"two 1s"or21.21is read off as"one 2, thenone 1"or1211.Given an integern, generate thenthsequence.Note: The sequence of inte 阅读全文

posted @ 2014-02-28 16:33 pengyu2003 阅读(132) 评论(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 the character'.'.A partially filled sudoku which is valid.Note:A valid Sudoku board (partially filled) is not necessarily solvable. Only the f 阅读全文

posted @ 2014-02-28 15:13 pengyu2003 阅读(146) 评论(0) 推荐(0) 编辑

Search Insert Position

摘要: 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 order.You may assume no duplicates in the array.Here are few examples.[1,3,5,6], 5 → 2[1,3,5,6], 2 → 1[1,3,5,6], 7 → 4[1,3,5,6], 0 → 0注意边界条件class Soluti 阅读全文

posted @ 2014-02-28 14:01 pengyu2003 阅读(149) 评论(0) 推荐(0) 编辑

导航