摘要: Given an array of integers, every element appearsthreetimes except for one. Find that single one.Note:Your algorithm should have a linear runtime comp... 阅读全文
posted @ 2015-05-16 22:03 amazingzoe 阅读(108) 评论(0) 推荐(0)
摘要: Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtime complexity... 阅读全文
posted @ 2015-05-16 21:42 amazingzoe 阅读(125) 评论(0) 推荐(0)
摘要: There areNchildren standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requi... 阅读全文
posted @ 2015-05-16 19:42 amazingzoe 阅读(177) 评论(0) 推荐(0)
摘要: There areNgas stations along a circular route, where the amount of gas at stationiisgas[i].You have a car with an unlimited gas tank and it costscost[... 阅读全文
posted @ 2015-05-16 16:15 amazingzoe 阅读(235) 评论(0) 推荐(0)
摘要: Given amxnmatrix, if an element is 0, set its entire row and column to 0. Do it in place.click to show follow up.Follow up:Did you use extra space?A s... 阅读全文
posted @ 2015-05-14 22:29 amazingzoe 阅读(140) 评论(0) 推荐(0)
摘要: The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrepresenting the total number... 阅读全文
posted @ 2015-05-14 21:52 amazingzoe 阅读(127) 评论(0) 推荐(0)
摘要: You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?分析:先沿对角线进行对折,然后沿水平中... 阅读全文
posted @ 2015-05-13 23:23 amazingzoe 阅读(138) 评论(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 with ... 阅读全文
posted @ 2015-05-13 17:02 amazingzoe 阅读(171) 评论(0) 推荐(0)
摘要: The set[1,2,3,…,n]contains a total ofn! unique permutations.By listing and labeling all of the permutations in order,We get the following sequence (ie... 阅读全文
posted @ 2015-05-13 16:26 amazingzoe 阅读(116) 评论(0) 推荐(0)
摘要: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possibl... 阅读全文
posted @ 2015-05-12 23:15 amazingzoe 阅读(164) 评论(0) 推荐(0)