Challenge ~ The Box | Sololearn: Learn to code for FREE!


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!!

11/28/2017 5:24:30 PM


2 Answers

New Answer


//see my answer , a general solution with restrictions too


My bad😂.. Actually in our school they're teaching permutation & combination.. And I had this problem.. So I made a challenge of it😀