摘要: Factorial Trailing ZeroesGiven an integern, return the number of trailing zeroes inn!.题目意思:n求阶乘以后,其中有多少个数字是以0结尾的。方法一:class Solution: # @return an i... 阅读全文
posted @ 2015-03-27 15:47 繁星苑 阅读(183) 评论(0) 推荐(0) 编辑
摘要: Pascal's TriangleGivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,... 阅读全文
posted @ 2015-03-27 13:39 繁星苑 阅读(684) 评论(0) 推荐(0) 编辑
摘要: Given an array of sizen, find the majority element. The majority element is the element that appears more than⌊ n/2 ⌋times.You may assume that the arr... 阅读全文
posted @ 2015-03-27 10:00 繁星苑 阅读(125) 评论(0) 推荐(0) 编辑