摘要: Suppose you are at a party with n people (labeled from 0 to n - 1) and among them, there may exist one celebrity. The definition of a celebrity is tha 阅读全文
posted @ 2016-10-13 12:08 Machelsky 阅读(188) 评论(0) 推荐(0) 编辑
摘要: All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it is sometimes useful to 阅读全文
posted @ 2016-10-13 11:40 Machelsky 阅读(193) 评论(0) 推荐(0) 编辑
摘要: Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time complexity. 思路:有多少个0就是有多少个5. 零的产生就是5 阅读全文
posted @ 2016-10-13 10:31 Machelsky 阅读(123) 评论(0) 推荐(0) 编辑
摘要: You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Follow up:Could you do this in-place? 思路:对角线对称呼唤,Y 阅读全文
posted @ 2016-10-13 10:15 Machelsky 阅读(152) 评论(0) 推荐(0) 编辑
摘要: Follow up for "Find Minimum in Rotated Sorted Array":What if duplicates are allowed? Would this affect the run-time complexity? How and why? Suppose a 阅读全文
posted @ 2016-10-13 09:36 Machelsky 阅读(149) 评论(0) 推荐(0) 编辑