当前位置:网站首页>[leetcode notes] no118 Yanghui triangle
[leetcode notes] no118 Yanghui triangle
2022-06-24 00:05:00 【Allow some artists to get rich first 1】
This requires two layers for Circular questions it is to be noted that : Break the inherent thinking , Don't think about i=0 The time is 1 Instead, think in terms of computers The first 0 Start of bit instead of the first 1 position
class Solution {
public List<List<Integer>> generate(int numRows) {
List<List<Integer>> ret = new ArrayList<>();
for(int i =0;i<numRows;i++){
List<Integer> row = new ArrayList<>();
for(int j =0;j<=i;j++){
if(j==0||j==i){
row.add(1);
}else{
row.add(ret.get(i-1).get(j)+ret.get(i-1).get(j-1));
}
}
ret.add(row);
}
return ret;
}
}
边栏推荐
- Nice input edit box
- Usage of go in SQL Server
- Android AIDL:跨进程调用Service (AIDL Service),kotlininvoke函数
- How to ensure reliable power supply of Expressway
- What is medical treatment? AI medical concept analysis AI
- [interview experience package] summary of experience of being hanged during interview (I)
- List<? Extensions T > and list <? Super T > difference
- .NET 中的 Worker Service 介绍
- Cloud native architecture (05) - Application Architecture Evolution
- docker redis集群配置
猜你喜欢

docker redis集群配置

Andorid 开发艺术探索笔记(2),跨平台小程序开发框架

Test - use case - detail frenzy

Visual explanation of clockwise inner curve in Green's formula hole digging method

I was cheated by my colleagues to work overtime on weekends. I haven't seen redis used like this...

Taylor formula and common expansion

Return, const, volatile keywords

数据库中索引原理及填充因子

Three types of transactions in EF core (saveChanges, dbcontexttransaction, transactionscope)

Expander+listbox of WPF effect
随机推荐
Three Solution to the problem of inaccuracy in radiographic testing under the condition of non full screen canvas of JS
Multi store drug inventory system source code large chain drugstore management system source code
Revit API:明细表 ViewSchedule
【Bug】C# IQueryable里的元素更改不了值
Android - JNI 开发你所需要知道的基础,Android工程师面试题
log Network Execution Time
Classical Chinese can be programmed???
WPF效果之Expander+ListBox
[interview experience package] summary of experience of being hanged during interview (I)
医疗是什么?AI医疗概念解析AI
Six necessary open source projects for private activities
Keywords such as extern and struct
EasyCVR程序以服务启动异常,进程启动却正常,是什么原因?
SAVE: 软件分析验证和测试平台
UART协议时序总结
PMP Exam related calculation formula summary! Must see before examination
When the IOT network card device is connected to easycvr, how can I view the streaming IP and streaming time?
Comment utiliser l'entrepôt de données pour créer une table de synchronisation
Android 3年外包工面试笔记,有机会还是要去大厂学习提升,作为一个Android程序员
2018/gan:self attention generating adversarial networks