{"id":"60681b57-54ac-4fea-a237-fa87de4f366f","name":"Number Of Paths Along The Edges In Upper Half Of A Square Matrix","description":"1. You are given a number N, which represents the size of a square matrix.\r\n2. You have to find the total number of paths along the edges in the given square matrix.\r\n3. You are allowed to travel only in the upper half of the matrix(i.e you can't cross the middle diagonal of the matrix).","inputFormat":"A number N","outputFormat":"A number representing total number paths along the edges in upper half of given square matrix.","constraints":"1 <= N <= 15","sampleCode":{"cpp":{"code":""},"java":{"code":"import java.io.*;\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\r\n\tpublic static int solution(int n){\r\n\t\t// write your code here\r\n\t\t\r\n\t\treturn 0;\r\n\t }\r\n\t \r\n\tpublic static void main(String[] args) {\r\n\t\tScanner scn = new Scanner(System.in);\r\n\t\tint n = scn.nextInt();\r\n\t\tSystem.out.println(solution(n));\r\n\t}\r\n\r\n}"},"node":{"code":""},"ruby":{"code":""},"python":{"code":""}},"points":10,"difficulty":"easy","sampleInput":"3","sampleOutput":"5\r\n","questionVideo":"","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":"5539a6e8-c8bf-4f04-805c-e43e9d20e72a","name":"Dynamic Programming For Intermediate","slug":"dynamic-programming-for-intermediate-408","type":0},{"id":"ce10be31-d69a-4fa5-9c04-537298cfd472","name":"Number Of Paths Along The Edges In Upper Half Of A Square Matrix","slug":"number-of-paths-along-the-edges-in-upper-half-of-a-square-matrix","type":1}],"next":{"id":"962834e9-6824-43d9-84aa-82f8f9ef6295","name":"NUMBER OF PATHS ALONG THE EDGES IN UPPER HALF OF A SQUARE MATRIX MCQ","type":0,"slug":"number-of-paths-along-the-edges-in-upper-half-of-a-square-matrix-mcq"},"prev":{"id":"580b8530-224a-4a5d-9c02-09fc8d518ccb","name":"Number of Ways of Triangulation","type":3,"slug":"number-of-ways-of-triangulation"}}}

Number Of Paths Along The Edges In Upper Half Of A Square Matrix

1. You are given a number N, which represents the size of a square matrix. 2. You have to find the total number of paths along the edges in the given square matrix. 3. You are allowed to travel only in the upper half of the matrix(i.e you can't cross the middle diagonal of the matrix).

{"id":"60681b57-54ac-4fea-a237-fa87de4f366f","name":"Number Of Paths Along The Edges In Upper Half Of A Square Matrix","description":"1. You are given a number N, which represents the size of a square matrix.\r\n2. You have to find the total number of paths along the edges in the given square matrix.\r\n3. You are allowed to travel only in the upper half of the matrix(i.e you can't cross the middle diagonal of the matrix).","inputFormat":"A number N","outputFormat":"A number representing total number paths along the edges in upper half of given square matrix.","constraints":"1 <= N <= 15","sampleCode":{"cpp":{"code":""},"java":{"code":"import java.io.*;\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\r\n\tpublic static int solution(int n){\r\n\t\t// write your code here\r\n\t\t\r\n\t\treturn 0;\r\n\t }\r\n\t \r\n\tpublic static void main(String[] args) {\r\n\t\tScanner scn = new Scanner(System.in);\r\n\t\tint n = scn.nextInt();\r\n\t\tSystem.out.println(solution(n));\r\n\t}\r\n\r\n}"},"node":{"code":""},"ruby":{"code":""},"python":{"code":""}},"points":10,"difficulty":"easy","sampleInput":"3","sampleOutput":"5\r\n","questionVideo":"","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":"5539a6e8-c8bf-4f04-805c-e43e9d20e72a","name":"Dynamic Programming For Intermediate","slug":"dynamic-programming-for-intermediate-408","type":0},{"id":"ce10be31-d69a-4fa5-9c04-537298cfd472","name":"Number Of Paths Along The Edges In Upper Half Of A Square Matrix","slug":"number-of-paths-along-the-edges-in-upper-half-of-a-square-matrix","type":1}],"next":{"id":"962834e9-6824-43d9-84aa-82f8f9ef6295","name":"NUMBER OF PATHS ALONG THE EDGES IN UPPER HALF OF A SQUARE MATRIX MCQ","type":0,"slug":"number-of-paths-along-the-edges-in-upper-half-of-a-square-matrix-mcq"},"prev":{"id":"580b8530-224a-4a5d-9c02-09fc8d518ccb","name":"Number of Ways of Triangulation","type":3,"slug":"number-of-ways-of-triangulation"}}}
plane

Editor


Loading...

Number Of Paths Along The Edges In Upper Half Of A Square Matrix

easy

1. You are given a number N, which represents the size of a square matrix. 2. You have to find the total number of paths along the edges in the given square matrix. 3. You are allowed to travel only in the upper half of the matrix(i.e you can't cross the middle diagonal of the matrix).

Constraints

1 <= N <= 15

Format

Input

A number N

Output

A number representing total number paths along the edges in upper half of given square matrix.

Example

Sample Input

3

Sample Output

5

Discussions

Show Discussion

Related Resources

related resources

Turning Off Zen Mode