+ 45
[ASSIGNMENT] ๐ถ๐๐ทCHALLENGE ::: TETRAHEDRON ๐บ๐ก๐บ
Let there be a tetrahedron with vertices marked as A,B,C,D //image how a tetrahedron looks like https://goo.gl/images/quAWbz Your task is to find number of ways in which we can reach from point 'A' to point 'A' in n-steps . 'n' will be provided as the user input . Example : input : 3 output : 6 [ABCA,ABDA,ACBA,ACDA,ADBA,ADCA] ๐๐๐ALREADY SUBMITTED AS AN ASSIGNMENT๐๐๐
37 Answers
+ 14
sorry buddy but thats wrong
@Sayan
+ 13
challenge is to find number of ways
//if U show paths also ... then it would be gr8 ๐
+ 13
https://code.sololearn.com/c7qLtlI9Xmk6/#py
EDIT: Fixed a couple bugs, should be functioning now :)
EDIT 2: Thanks for marking mine correct ๐
How I decided to go about this was to try and actually find out all possible paths, using a recursive function. And I have to say, It was pretty fun ๐
+ 13
nice @Cestpasgrave
//me too not done with any formula first ... then noticed can also be done by combination .
+ 13
and I like a code or a helpful answer , rather than a unuseful answer@Sania
// and @Tomas , the challenge is little bit different ... read carefully
+ 12
@Oma try again
for input : 6
output : 183
+ 11
nice code โบ ... U can make it perfect
// 2nd last letter must not be A , else U can use A in between
+ 10
https://code.sololearn.com/cK1zUXWfox96/?ref=app
//have a look on this also , made by eliminating some cases
//& yes its also a 1-LINER recursion
+ 10
@Sayan Chandra ,
here the biggest advantage is SYMMETRY
//there was symmetry in tetrahedron , same in case of triangle ... thats what made it so small ...[๐ ie we can go to any of the other points from a point]
//okh, bye guys ... will come later [nice talking with u]
+ 9
Hello Gaurav,
I found a formula.
Could you check if results are okay please?
https://code.sololearn.com/crhALh7AX4ij
+ 9
hi @Adylbek ,
my post is not 4 chat purpose ... sorry
//If U have some question/doubt , then create a separate thread for that , would like to help U out
+ 8
@Sayan ,
yes its correct now โบ
+ 8
and why not as alternating row
https://code.sololearn.com/cDjRqh0qhkTc/?ref=app
+ 8
where is the explanation @Oma ๐
// I think I got it
congrats๐โ
@/*Unknown-name*/ 4 best answer marked
//for answering fast & with paths ๐โบ
+ 8
nice try & thanks for participating @Sylar , but not correct
//U can have a look at outputs for more possible inputs
I inputted 4 , but output was showing E in a path (but a tetrahedron have only 4 vertices)
+ 7
@Oma looks correct to me โบ
//yes that correct ๐
//& @cab. , mix ... remove your unmeaningful answers
+ 6
not so ugly recursion
https://code.sololearn.com/ccwCpQUCXZbB/?ref=app
+ 6
@sayan thats the result after 24h .... not bad!
+ 6
@Gaurav post this as assignment in Lessons Factory ๐
+ 6
My solution :
https://code.sololearn.com/cThA3656QImi/?ref=app
BTW , I know I am late.