10扩展. 矩阵覆盖
矩形覆盖
http://www.nowcoder.com/questionTerminal/72a5a919508a4251859fb2cfb987a0e6
每个小矩阵可以横着放或者竖着放,所以依然是斐波那契数列
if number == 0: return 0 res = [1,2] for i in range(2,number): res.append(res[i-1]+res[i-2]) return res[number-1]
矩形覆盖
http://www.nowcoder.com/questionTerminal/72a5a919508a4251859fb2cfb987a0e6
每个小矩阵可以横着放或者竖着放,所以依然是斐波那契数列
if number == 0: return 0 res = [1,2] for i in range(2,number): res.append(res[i-1]+res[i-2]) return res[number-1]
相关推荐