Ad
  • Default User Avatar

    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.

  • Default User Avatar

    I'm sorry but i don't follow you, could you please elaborate?

    The kata is not interested in testing if you returned any postfix expression that evaluates the same as the infix input.

    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.

  • Default User Avatar

    Can someone explain why 275*+ and not 75*2+ is the correct answer to 2+7*5? Shouldn't both answers be acceptable?

  • Default User Avatar

    thank you will check it out.

  • Default User Avatar

    What's the point of a spoiler flag in a solutions thread?

  • Default User Avatar

    @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.

  • Default User Avatar

    Thanks, I need to wring my brains

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Lend me your brains o kind soul

  • Default User Avatar

    Nice useful in real life work Kata, iLike!

  • Default User Avatar

    Our codes look so shit compared to these 1 liners :'(

  • Default User Avatar

    Ouch this one is tough... still can't figure out how to solve it, although I understood the problem fine for once.

  • Default User Avatar

    This would've been crazy to solve without looking at the inputs being supplied.

  • Default User Avatar

    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

  • Default User Avatar

    I love your regex formatting though... must remember to comment it so well in this \n formatting.

  • Loading more items...