+ 11

Challenge ~ The Box

Imagine a box; Consisting of several boxes. Let the lower left corner of the big box be A and the upper right corner be B. Take a number(n) as a user input and that will be the number of small boxes i.e, n*n. Find the number of ways in which a person can reach from A to B given that he can only walk on the edges of small boxes. For example: If the user inputs 3, the box will be 3*3. So one way is (R)ight, R, R, (U)p, U, U Another is R, U, R, U, R, U.. And so on. 🎆BONUS🎆: Print all the possible ways!!

28th Nov 2017, 5:24 PM
Yash✳️
Yash✳️ - avatar
2 Respostas
+ 32
//see my answer , a general solution with restrictions too https://www.sololearn.com/Discuss/835128/?ref=app
28th Nov 2017, 5:32 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 11
My bad😂.. Actually in our school they're teaching permutation & combination.. And I had this problem.. So I made a challenge of it😀
28th Nov 2017, 5:35 PM
Yash✳️
Yash✳️ - avatar