MCPcopy Create free account
hub / github.com/apna-college/Alpha / tilingProblem

Method tilingProblem

7_RecursionBasics/RecursionBasics.java:107–122  ·  view source on GitHub ↗
(int n)

Source from the content-addressed store, hash-verified

105 }
106
107 public static int tilingProblem(int n) { // 2 x n (floor size)
108 //base case
109 if(n == 0 || n == 1) {
110 return 1;
111 }
112
113 //kaam
114 //vertical choice
115 int fnm1 = tilingProblem(n-1);
116
117 //horizontal choice
118 int fnm2 = tilingProblem(n-2);
119
120 int totWays = fnm1 + fnm2;
121 return totWays;
122 }
123
124 public static void removeDuplicates(String str, int idx, StringBuilder newStr, boolean map[]) {
125 if(idx == str.length()) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected