
题目描述
我们可以用21的小矩形横着或者竖着去覆盖更大的矩形。请问用n个21的小矩形无重叠地覆盖一个2*n的大矩形,总共有多少种方法?
思路
Just write down the result array and we find that the Array is (1),1,2,3,5,8,13,21…
It is a Fibonacci array!
Be careful for the index.
代码
1 |
public int RectCover(int target) { |




近期评论