摘要: Single Number IIIGiven2*n + 2numbers, every numbers occurs twice except two, find them.ExampleGiven[1,2,2,3,4,4,5,3]return1and5ChallengeO(n) time, O(1...阅读全文
posted @ 2015-12-08 23:56 -.-| 阅读(42) 评论(0) 编辑
摘要: Single Number IIGiven3*n + 1numbers, every numbers occurs triple times except one, find it.ExampleGiven[1,1,2,3,3,3,2,2,4,1]return4ChallengeOne-pass, ...阅读全文
posted @ 2015-12-08 23:34 -.-| 阅读(56) 评论(0) 编辑
摘要: Spiral MatrixGiven a matrix ofmxnelements (mrows,ncolumns), return all elements of the matrix in spiral order.ExampleGiven the following matrix:[ [ 1,...阅读全文
posted @ 2015-12-08 22:45 -.-| 阅读(78) 评论(0) 编辑