Pascal’s Triangle

vector<vector<int>> generate(int num)
{
vector<vector<int>> result;
vector<int> array;
for (int i = ; i <= num; i++)
{
for (int j = i - ; j > ; j--)
{
array[j] = array[j - ] + array[j];
}
array.push_back();
result.push_back(array);
}
}
Pascal’s Triangle的更多相关文章
- [LeetCode] 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, ...
- [LeetCode] Pascal's Triangle 杨辉三角
Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Retur ...
- 【leetcode】Pascal's Triangle II
题目简述: Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3, Retur ...
- 【leetcode】Pascal's Triangle
题目简述: Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5 ...
- LeetCode 118 Pascal's Triangle
Problem: Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows ...
- LeetCode 119 Pascal's Triangle II
Problem: Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3,Ret ...
- LeetCode - Pascal's Triangle II
题目: Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3, Return ...
- 【leetcode】Pascal's Triangle I & II (middle)
Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Retur ...
- 118. Pascal's Triangle
题目: Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5, ...
- [LeetCode]题解(python):119 Pascal's Triangle II
题目来源 https://leetcode.com/problems/pascals-triangle-ii/ Given an index k, return the kth row of the ...
随机推荐
- http请求过程简要
一次http请求主要分为3个大步. 建立tcp连接. 这里就发生了经典的tcp三次握手.做个类比解释下,tcp好比http的秘书,和厂家(服务器端)做买卖.老板(http)叫秘书(tcp)去联系一下, ...
- 在ubuntu server上安装沸腾时刻环境
1. 安装php5.6 http://phpave.com/upgrade-to-php-56-on-ubuntu-1404-lts/ 按照这篇文章的顺序来做,可以安装最新5.6版本php 安装好了以 ...
- js的各种继承
请先看这个链接:https://segmentfault.com/a/1190000002440502 还有一个里边有js的采用临时方法的继承 http://javapolo.iteye.com/bl ...
- SpringMVC实现Restful风格的WebService
1.环境 JDK7 MyEclipse2014 tomcat8 maven 3.3.3 spring4.1.4 2.创建maven工程 使用MyEclipse创建maven工程的方式可以参考这篇博文( ...
- 传智168期JavaEE就业班 day01-html
* HTML * HTML: HyperText Markup Language 超文本标记语言. * HTML是最基础的网页语言. * HTML的代码都是由标签所组成. * HTML的基本格式 &l ...
- struts2升级报ActionContextCleanUp<<is deprecated。Please use the new filters
把web.xml中配置struts.xml的文件改成 <?xml version="1.0" encoding="UTF-8"?> <web- ...
- java.lang.NoClassDefFoundError: com/sun/mail/util/LineInputStreamsJavamail问题
异常描述如下: Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/LineI ...
- python IO文件处理
python的文件读写操作符有:r w a r+ w+ rb wb 除了以file的方式打开文件,还有一种方式就是open了,两个的用法是一模一样的,可以看成open就是file的别名 下面这个表格是 ...
- oracle练习题后15个
31,32题更正: SQL> --31. 查询所有教师和同学的name.sex和birthday. SQL> select sname, ssex, sbirthday from stud ...
- iframe标签用法详解(属性、透明、自适应高度)
1.iframe 定义和用法 iframe 元素会创建包含另外一个文档的内联框架(即行内框架). HTML 与 XHTML 之间的差异 在 HTML 4.1 Strict DTD 和 XHTML 1. ...