题解 | #矩形覆盖#
矩形覆盖
http://www.nowcoder.com/practice/72a5a919508a4251859fb2cfb987a0e6
递归法
class Solution { public: int rectCover(int number) { if(number<2) return number; int res; generate(number, res); return res; } void generate(int number, int &res){ if(number==0){ res++; return; } if(number<0){ return; } generate(number-1, res); generate(number-2, res); } };