MeetCode
Choose Team With Captain
C
C++
Computer Mathematics
CSS
DSA
HTML
Java
JavaScript
NodeJS
PHP
Programming Interview
Python
ReactJS
SQL
Run
Submit
Dark
Problem Statement
Solutions
Submissions
Choose Team With Captain
Medium
Computer Mathematics
Combinatorics
27 views
Explanation
Complexity
Problem Statement
Choose r people from n and also pick a captain from chosen team.
Input Format
Two integers n r.
Output Format
One integer.
Example
Input
5 3
Output
30
Constraints
0
Input / Output Format
Input Format
Two integers n r.
Output Format
One integer.
Constraints
0
Examples
Input:
5 3
Output:
30
Example Solution (Public)
Computer Mathematics
Ways = C(n,r)*r. First choose team, then captain among r.
Official Solution Code
Wrap
Copy
Ways = C(n,r)*r. First choose team, then captain among r.
Please
login
to submit solutions.
Editor
C
C++
Computer Mathematics
CSS
DSA
HTML
Java
JavaScript
NodeJS
PHP
Programming Interview
Python
ReactJS
SQL
Test Cases
Output
Submission Result
Input
5 3
Expected Output
30
Compile Output
Error
Output
Please
login
to submit solutions.