`{"id":"d674ef40-59eb-4efe-8a01-3147d060b612","name":"Circle And Chords","description":"1. You are given a number N.\r\n2. There are 2*N points on a circle. You have to draw N non-intersecting chords on a circle.\r\n3. You have to find the number of ways in which these chords can be drawn.","inputFormat":"A number N","outputFormat":"Check the sample output and question video.","constraints":"1 &lt;= N &lt;= 1000\r\n1 &lt;= arr[i] &lt;= 100","sampleCode":{"cpp":{"code":""},"java":{"code":"import java.io.*;\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\r\n public static long NumberOfChords(int n){\r\n //write your code here\r\n \r\n return 0;\r\n }\r\n public static void main(String[] args) {\r\n\t\tScanner scn = new Scanner(System.in);\r\n int n = scn.nextInt();\r\n System.out.println(NumberOfChords(n));\r\n\t}\r\n}"},"node":{"code":""},"ruby":{"code":""},"python":{"code":""}},"points":10,"difficulty":"easy","sampleInput":"3\r\n","sampleOutput":"5\r\n","questionVideo":"https://www.youtube.com/embed/qgQg1BcCWBA?end=174","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":"ff8ffed1-86a4-4537-baa1-68c633b539ae","name":"Circle And Chords","slug":"circle-and-chords","type":1}],"next":{"id":"4e0d8ed4-8d3d-45d2-bd33-1dee5b3ee366","name":"circle and chords MCQ","type":0,"slug":"circle-and-chords-mcq"},"prev":{"id":"a52f205d-8738-4c59-b212-bf04758a2925","name":"Optimal Binary Search Tree (BST)","type":3,"slug":"optimal-binary-search-tree-bst"}}}`

# Circle And Chords

1. You are given a number N. 2. There are 2*N points on a circle. You have to draw N non-intersecting chords on a circle. 3. You have to find the number of ways in which these chords can be drawn.

`{"id":"d674ef40-59eb-4efe-8a01-3147d060b612","name":"Circle And Chords","description":"1. You are given a number N.\r\n2. There are 2*N points on a circle. You have to draw N non-intersecting chords on a circle.\r\n3. You have to find the number of ways in which these chords can be drawn.","inputFormat":"A number N","outputFormat":"Check the sample output and question video.","constraints":"1 &lt;= N &lt;= 1000\r\n1 &lt;= arr[i] &lt;= 100","sampleCode":{"cpp":{"code":""},"java":{"code":"import java.io.*;\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\r\n public static long NumberOfChords(int n){\r\n //write your code here\r\n \r\n return 0;\r\n }\r\n public static void main(String[] args) {\r\n\t\tScanner scn = new Scanner(System.in);\r\n int n = scn.nextInt();\r\n System.out.println(NumberOfChords(n));\r\n\t}\r\n}"},"node":{"code":""},"ruby":{"code":""},"python":{"code":""}},"points":10,"difficulty":"easy","sampleInput":"3\r\n","sampleOutput":"5\r\n","questionVideo":"https://www.youtube.com/embed/qgQg1BcCWBA?end=174","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":"ff8ffed1-86a4-4537-baa1-68c633b539ae","name":"Circle And Chords","slug":"circle-and-chords","type":1}],"next":{"id":"4e0d8ed4-8d3d-45d2-bd33-1dee5b3ee366","name":"circle and chords MCQ","type":0,"slug":"circle-and-chords-mcq"},"prev":{"id":"a52f205d-8738-4c59-b212-bf04758a2925","name":"Optimal Binary Search Tree (BST)","type":3,"slug":"optimal-binary-search-tree-bst"}}}`

Editor

# Circle And Chords

easy

1. You are given a number N. 2. There are 2*N points on a circle. You have to draw N non-intersecting chords on a circle. 3. You have to find the number of ways in which these chords can be drawn.

## Constraints

1 <= N <= 1000 1 <= arr[i] <= 100

## Format

A number N

### Output

Check the sample output and question video.

## 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;}3 ```

### 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;}5 ```

Question Video

Discussions

Show Discussion

Related Resources