We can use the small rectangle of 2*1 to cover the larger rectangle horizontally or vertically. Can you tell me how many methods 1 use the array structure traversal method if the small rectangle with n 2*1 covers a 2*n large rectangle without overlapping (target==1 | | target==0) return 1; int [] arr = new int [target+1]; arr[0] = 1; arr[1] = 1; for (int i=2;i<=target;i++) { arr[i] = arr[i-1]+arr[i-2]; } &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;RETURN&NBSP;ARR[TARGET];2 uses two int variables and a temporary variable in a while statement without the help of the array structure temp If (target==1 | | target==0) return 1; int num1 = 1,num2 = 1; while (target>1) { Int temp = num2; num2 +=num1; num1=temp; target--; } return num2; 3 recursive efficiency minimum if (target==1 | | target==0) return 1; if (target>1) return rectcover (target-1) +rectcover (target-2); return 0; here because of the use of OJ, when I above the if (target==1 | | target==0) return 1; wrote a if (target==1) return 1; if (target==0) return 1; if (target>1) return Rectcover (target-1) +rectcover (target-2); return 0;o J System on the judgment time has timed out and really think about the problem that can be judged once, why do you want two times?
A variant of the Fibonacci sequence on a practical issue