Showing:
Handle Score
@Ibrahim Nash 6564
@mb1973 5785
@Quandray 5275
@akhayrutdinov 5111
@saiujwal13083 5074
@kirtidee18 4639
@sanjay05 3762
@mantu_singh 3712
@gfgaccount 3627
@marius_valentin_dragoi 3525
Number of ways
Medium Accuracy: 29.49% Submissions: 1838 Points: 4

Given a value N. In how many ways you can construct a grid of size N x 4 using tiles of size 1 x 4.

Example 1:

Input: N = 1
Output: 1
Explaination: There is only one way.

Example 2:

Input: N = 4
Output: 2
Explaination: The first way can be when all
the 1 x 4 tiles are arranged horizontally.
Second way can be when all the 1 x 4 tiles
are arranged vertically.

You do not need to read input or print anything. Your task is to complete the function arrangeTiles() which takes the value N as input parameter and returns the number of ways to make N x 4 grid using 1 x 4 tiles.

Expected Time Complexity: O(N)
Expected Auxiliary Space: O(N)

Constraints:
1 ≤ N ≤ 80

### Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Number of ways