题目描述

我们可以用2*1的小矩形横着或者竖着去覆盖更大的矩形。请问用n个2*1的小矩形无重叠地覆盖一个2*n的大矩形,总共有多少种方法?
 
1 public class Solution {
2     public int RectCover(int target) {
3         return target<3?target:RectCover(target-1)+RectCover(target-2);
4     }
5 }

 

相关文章:

猜你喜欢
  • 2022-12-23
  • 2021-11-21
  • 2021-07-29
  • 2022-02-15
  • 2022-12-23
  • 2022-01-21
相关资源
相似解决方案