Ad
  • Custom User Avatar

    Nice kata but unfortunately some Elixir test cases are broken, for example:

    Testing input: "38691?+-198280=18863?"
    1) test Fixed tests More tests (TestSuite)
         test/solution_test.exs:51
         Assertion with == failed
         code:  assert Kata.solve_runes(s) == sol
         left:  0
         right: 8
         stacktrace:
           (elixir 1.11.4) lib/enum.ex:798: Enum."-each/2-lists^foreach/1-0-"/2
           test/solution_test.exs:64: (test)
    

    Proper solution is 4 in this case, which also works on my local machine:

    assert(4 = CodeWars.Numbers.solve_runes("38691?+-198280=18863?"))
    
  • Custom User Avatar

    I agree, there is no good balance in performance constraints between languages.

  • Custom User Avatar

    47848+-?39008=-5911?0
    47,848+-(100,000x + 39,008) = -(591,100 + 10x)
    47,848 - 100,000x - 39,008 = -591,100 - 10x
    -99,990x = -599,940
    x = 6