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.
I fixed this solution here: https://www.codewars.com/kata/reviews/52a78825cdfc2cfc87000008/groups/620b7948793105000108b662
True, nice catch! Basically this happens because this solution does not calculate well the (-3 - 2), it returns -1 instead of -5. It would be nice to add this test to the solution validation.
This solution returns incorrect result for expression:
(2 - 2.5) - (-3 - 2) * (-5)
Returns -5.5, but should be -25.5
Keep trying. I could have solved this kata with loops, but it's often much more fun for me to try to solve the kata with functional programming techniques. A second challenge for some of these kata that often comes for free with functional approachs is code-golfing -- I like to see if I can solve the problem with a relatively short single line of code.
What a beautiful solution! I've thought in this direction, but regretfully haven't got to the end.
This comment is hidden because it contains spoiler information about the solution
RegExps are wonderful, but I'd prefer to work with a copy of input array since we mutate it.