Football Player - Total Dribble Paths

 Coding Problem Keys 

 Football Player - Total Dribble Paths 

 Problem Statement 

A football coach wants his team to improve their dribbling skills. So he sets up a R*C grid, where R is the number of rows and C is the number of columns. From any given cell, a player can only dribble to the right cell or bottom cell.

A player always starts from top left most cell and must end at bottom right most cell where he can collect the reward if he has dribbled according to the rules above.



The program must accept R, C and print the total number of possible paths P in which a player can reach the destination.

 Boundary Condition(s) 

1 <= R, C <= 100

 Input Format 

The first line contains N.
The second line contains C.

 Output Format 

The first line contains P.

 Example Input/Output 1 

 Input 

2
3

 Output 

3

 Example Input/Output 2 

 Input 

3
3

 Output 

6

 Example Input/Output 3 

 Input 

25
21

 Output 

1761039350070

 Note: Max Execution Time Limit: 5000 millisecs 

 Solution 

 Programming Language: Python 3 Language 


n=int(input())
m=int(input())
c=[[0 for i in range(m)] for i in range(n)]
for i in range(n):
    c[i][0]=1
for j in range(m):
    c[0][j]=1
for i in range(1,n):
    for j in range(m):
        c[i][j]=c[i-1][j]+c[i][j-1]
print(c[n-1][m-1])

 (Note: Incase If the code doesn't Pass the output kindly comment us with your feedback to help us improvise.) 

Comments

Popular Posts

Toggle Consonants Adjacent to Vowels

String Pattern - Inverted U

Top Scoring Batsman - TEST ODI 20-20

Java - Method Overriding - Area

Balloon Count Burst by Ath Kid

Microsoft

Mango Distribution