Skip to content

Commit f21dc74

Browse files
Create Tiling_Problem.py
1 parent dba8eec commit f21dc74

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

backtracking/Tiling_Problem.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Python3 program to count the
2+
# no. of ways to place 2*1 size
3+
# tiles in 2*n size board.
4+
def getNoOfWays(n):
5+
6+
# Base case
7+
if n <= 2:
8+
return n
9+
10+
return getNoOfWays(n - 1) + getNoOfWays(n - 2)
11+
12+
# Driver Code
13+
print(getNoOfWays(4))
14+
print(getNoOfWays(3))
15+
16+
# This code is contributed by Kevin Joshi

0 commit comments

Comments
 (0)