Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Intersting... very intersing. I tested 275*+ and 75*2+ ova here and both give same result 37. But ofc, you said in your 1st sentence of 1st comment that that is not the end goal.
I must apply the rules to create the correct postfix, or so I understand. So basically whenever confronted with such a choice, my code should dump all the signs at the end.
Sidenote - first time heard bijection but don't see why there is no bijection between
2+7*5
&75*2
...wtf. Lol i won't delete what I wrote, you're right! I see the bijection now! So basically my funk's ouptut should have the numbers in same order as they're given in the inputted infix string.
Thanks a ton for your wonderful help & enlightenment of this simpleton! There's no way i'll be able to convert the solution in my brain to actual code lol, but at least good to know that my brain can solve this correctly now.
I'm sorry but i don't follow you, could you please elaborate?
But i thought that is exactly what needs to be done. My func needs to return a postfix string, which when evaluated should equal the inputted infix str's evluation. Isn't that the whole point?
Your 2nd sentence totally went over my smooth brain. 3rd sentence yes agreed, order of nos is same, but order of the signs can be different & yet give the same answer.
Can someone explain why
275*+
and not75*2+
is the correct answer to 2+7*5? Shouldn't both answers be acceptable?thank you will check it out.
What's the point of a spoiler flag in a solutions thread?
@teoretik-eugene - Dude I love you, thank you. Taking your advice I was finally able to solve this. I'll leave this magical explanation of BFS algo here: https://www.youtube.com/watch?v=pcKY4hjDrxk
Just a single watch of that video, then i got down to writing my code from scratch, & within 15 mins my code passed all the tests. I don't know what is magical about that video but it helped me solve the problem without thinking at all.
Thanks, I need to wring my brains
This comment is hidden because it contains spoiler information about the solution
Lend me your brains o kind soul
Nice useful in real life work Kata, iLike!
Our codes look so shit compared to these 1 liners :'(
Ouch this one is tough... still can't figure out how to solve it, although I understood the problem fine for once.
This would've been crazy to solve without looking at the inputs being supplied.
I came to the comments hoping to find fellow lamebrains goung "wth is this, can't understand sit"... turns out i'm the only lamebrain :( #fbm
I love your regex formatting though... must remember to comment it so well in this \n formatting.
Loading more items...