Beta

Grouping Expressions with Parentheses

Description
Loading description...
Mathematics
Algorithms
  • Please sign in or sign up to leave a comment.
  • Blind4Basics Avatar
    • skidd Avatar

      I haven't solved that kata, but the task in this one seems quite different, as you are adding parenthesis into a string instead of removing them, where there can be many more possible outputs. This one has additional performace requirements as well.

      Question marked resolved by skidd 2 years ago
    • Voile Avatar

      They're completely different.

  • Voile Avatar

    The input term size is very small because reference solution is very slow. Perhaps it should be replaced a faster solution to increase the input term size?

    • skidd Avatar

      Thanks for the feedback and much faster solution. Using your solution, I was able to add a test for n=11 and 2 more with n=10.

      Suggestion marked resolved by skidd 2 years ago
    • Voile Avatar

      My submitted solution has a bypass to the incorrect behaviour, which is now mandated by the fixed test and random tests ;-(

      You need to fix the tests and remove the bypass in the solution.

    • skidd Avatar

      It should now be fixed.

    • Voile Avatar

      Now there's an additional requirement to remove all trailing 0s after the decimal point, but it is not mentioned in the description (still says "decimals ending with .0").

    • skidd Avatar

      Added this to the description.

  • Voile Avatar

    Random tests:

    Failed for equation " 6804  >>   5727.07": {'6804 >> 5727.07'} should equal {'6804 >> 57277'}
    
    Failed for equation "1620.697847   ==   628.084129": {'1620.697847 == 628.084129'} should equal {'1620.697847 == 62884129'}
    
    Failed for equation " 5432.0594or5402.0": {'5432.0594 or 5402'} should equal {'5432594 or 5402'}
    

    This should definitely be added to fixed tests as well (to catch incorrect checking of .0).