`{"id":"338edd39-fdc1-47aa-9469-5642b7cf623d","name":"Tiling With 2 * 1 Tiles","description":"1. You are given a number n representing the length of a floor space which is 2m wide. It's a 2 * n board.\r\n2. You've an infinite supply of 2 * 1 tiles.\r\n3. You are required to calculate and print the number of ways floor can be tiled using tiles.","inputFormat":"A number n","outputFormat":"A number representing the number of ways in which the number of ways floor can be tiled using tiles.\r\n","constraints":"1 &lt;= n &lt;= 100","sampleCode":{"cpp":{"code":"#include <iostream>\n#include <vector> \n\nusing namespace std ;\n\n int main() {\n int n ;\n cin>>n ;\n //write your code here\n }"},"java":{"code":"import java.io.*;\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\r\n public static void main(String[] args) throws Exception {\r\n\r\n }\r\n}"},"python":{"code":"def numberOfTiles(N):\n # write your code here\n \nN = int(input())\nprint(numberOfTiles(N))"}},"points":10,"difficulty":"easy","sampleInput":"8","sampleOutput":"34","questionVideo":"https://www.youtube.com/embed/dVT9JeUMMDE?end=131","hints":[],"associated":[],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"52d62581-1313-45fb-aaf0-1d72a45f6a50","name":"Dynamic Programming And Greedy For Beginners","slug":"dynamic-programming-and-greedy-for-beginners","type":0},{"id":"eee94a66-c8c6-45b7-908f-c6d22de2f2ab","name":"Tiling With 2 * 1 Tiles","slug":"tiling-with-2-1-tiles","type":1}],"next":{"id":"1f8a5074-a75d-49f2-bcd8-0ef19c03a771","name":"Tiling with 2x1 tiles","type":3,"slug":"tiling-with-2x1-tiles"},"prev":{"id":"34405f41-0f24-4d14-b3a3-f767e8cbccc9","name":"Paint Fence","type":3,"slug":"paint-fence"}}}`

# Tiling With 2 * 1 Tiles

1. You are given a number n representing the length of a floor space which is 2m wide. It's a 2 * n board. 2. You've an infinite supply of 2 * 1 tiles. 3. You are required to calculate and print the number of ways floor can be tiled using tiles.

`{"id":"338edd39-fdc1-47aa-9469-5642b7cf623d","name":"Tiling With 2 * 1 Tiles","description":"1. You are given a number n representing the length of a floor space which is 2m wide. It's a 2 * n board.\r\n2. You've an infinite supply of 2 * 1 tiles.\r\n3. You are required to calculate and print the number of ways floor can be tiled using tiles.","inputFormat":"A number n","outputFormat":"A number representing the number of ways in which the number of ways floor can be tiled using tiles.\r\n","constraints":"1 &lt;= n &lt;= 100","sampleCode":{"cpp":{"code":"#include <iostream>\n#include <vector> \n\nusing namespace std ;\n\n int main() {\n int n ;\n cin>>n ;\n //write your code here\n }"},"java":{"code":"import java.io.*;\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\r\n public static void main(String[] args) throws Exception {\r\n\r\n }\r\n}"},"python":{"code":"def numberOfTiles(N):\n # write your code here\n \nN = int(input())\nprint(numberOfTiles(N))"}},"points":10,"difficulty":"easy","sampleInput":"8","sampleOutput":"34","questionVideo":"https://www.youtube.com/embed/dVT9JeUMMDE?end=131","hints":[],"associated":[],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"52d62581-1313-45fb-aaf0-1d72a45f6a50","name":"Dynamic Programming And Greedy For Beginners","slug":"dynamic-programming-and-greedy-for-beginners","type":0},{"id":"eee94a66-c8c6-45b7-908f-c6d22de2f2ab","name":"Tiling With 2 * 1 Tiles","slug":"tiling-with-2-1-tiles","type":1}],"next":{"id":"1f8a5074-a75d-49f2-bcd8-0ef19c03a771","name":"Tiling with 2x1 tiles","type":3,"slug":"tiling-with-2x1-tiles"},"prev":{"id":"34405f41-0f24-4d14-b3a3-f767e8cbccc9","name":"Paint Fence","type":3,"slug":"paint-fence"}}}`

Editor

# Tiling With 2 * 1 Tiles

easy

1. You are given a number n representing the length of a floor space which is 2m wide. It's a 2 * n board. 2. You've an infinite supply of 2 * 1 tiles. 3. You are required to calculate and print the number of ways floor can be tiled using tiles.

1 <= n <= 100

## Format

A number n

### Output

A number representing the number of ways in which the number of ways floor can be tiled using tiles.

## Example

Sample Input

`.css-23h8hz{color:inherit;font-size:0.875rem;line-height:1.125rem;letter-spacing:0.016rem;font-weight:var(--chakra-fontWeights-normal);white-space:pre-wrap;}8`

### Sample Output

`.css-3oaykw{color:var(--chakra-colors-active-primary);font-size:0.875rem;line-height:1.125rem;letter-spacing:0.016rem;font-weight:var(--chakra-fontWeights-normal);white-space:pre-wrap;font-family:Monospace;}34`

Question Video

Discussions

Show Discussion

Related Resources