摘要: 本题如果用递归做,超时。注意要对结果取余。递归+记忆可以通过。如下: 1 class Solution { 2 int[] arr=new int[101]; 3 {//这里不加大括号会报错 4 Arrays.fill(arr,-1); 5 } 6 public int fib(int n) { 7 阅读全文
posted @ 2021-03-10 22:42 wsshub 阅读(44) 评论(0) 推荐(0)