119 Pascal's Triangle
2015-05-29 07:16
435 查看
public class Solution { public ArrayList<Integer> getRow(int rowIndex) { ArrayList<Integer> res = new ArrayList<Integer>(); if (rowIndex < 0) { return res; } res.add(1); for (int i = 1; i <= rowIndex; i++) { for (int j = res.size() - 2; j >= 0; j--) { res.set(j+1, res.get(j) + res.get(j + 1)); } res.add(1); } return res; } }
相关文章推荐
- Floyd Warshall 弗洛伊德算法---最短路径
- ScrollView中嵌套ListView置顶问题
- 【末世旅行之C++】C++中一个冒号和两个冒号的用法
- Codeforces Round #304 (Div. 2) D. Soldier and Number Game
- 利用php获取图片完整Exif信息类 获取图片详细完整信息类
- php实现手机拍照上传头像功能
- php获取文件mime类型Fileinfo等方法
- php接收二进制数据流转换成图片
- php 接收二进制流转换成图片
- 通过JS语句判断WEB网站的访问端是电脑还是手机
- js+jquery检测用户浏览器型号(包括对360浏览器的检测)
- php中getimagesize函数的用法
- 0529
- PHP图片上传程序(完整版)
- 上传文件格式控制的困惑(application/octet-stream 限制不了BAT等格式上传)问题解决
- android 上传文件"Content-Type",为"application/octet-stream" 用php程序在服务端用$GLOBALS['HTTP_RAW_POST_DATA']接受(二)
- windows server2012 之部署用户隔离的FTP站点
- 用 Apache 和 Subversion 搭建安全的版本控制环境
- C语言优先级之计算总结
- ABP(现代ASP.NET样板开发框架)系列之4、ABP模块系统