for(inti =1; i <= n; i++) {
dp[i][1] =1;
}
for(inti =1; i <= n; i++) {
dp[i][i] =1;
}
感谢题解,不过代码有点小问题,两个for循环多余,做的事情在下面重复了,而且第二个for循环dp[i][i]数组越界
😅