2016年4月30日

Climbing Stairs

摘要: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you cl 阅读全文

posted @ 2016-04-30 16:41 Sheryl Wang 阅读(106) 评论(0) 推荐(0) 编辑

Pascal's Triangle II

摘要: Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3,Return [1,3,3,1]. Pascal's Triangle为给出行数,求所有结果,这题是给出任意行号,求该行的结 阅读全文

posted @ 2016-04-30 15:49 Sheryl Wang 阅读(167) 评论(0) 推荐(0) 编辑

Pascal's Triangle

摘要: Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return 简单题,不过却有解法上还是有多种的。首先给出我简单直接的解法: 主要就是每行处理,将开始的1和最 阅读全文

posted @ 2016-04-30 15:32 Sheryl Wang 阅读(155) 评论(0) 推荐(0) 编辑

导航