Ad
  • Default User Avatar

    Should that type of cases be considered? And if so, what would be the rules to follow?

    -7/9-    transpose +3:
    -4/6-
    
    
    -10/12-  or  -10/12-  or  -10/12-
    -7/9---  or  --7/9--  or  -7-/9--
    

    ??

    Might be a bad idea to introduce that, though...

  • Custom User Avatar
    var random1 = makeString(1,5);
    Test.assertEquals(coinFlipper(random1), ...
    

    Why are you passing a string instead of number?

  • Custom User Avatar

    Description is contradictory - at the start it says:

    Outputs should take the form of an array, containing two strings:

    [ "answer" , "remainder" ]

    Then later it says:

    A divide by "0" should return "Infinity", dividing "0" by anything should give you "0" in return, and "0" ÷ "0" should return "NaN".

    Perhaps you could reword the first part as follows: when x and y are both nonzero, return an array of the form ["answer", "remainder"]; otherwise ... (list out each edge case and how to handle them)

    And the tests are really poorly written. Please compare arrays using Test.assertDeepEquals.

    It's also worth a mention that the "integers" passed in can be extremely huge so ordinary JavaScript arithmetic would not work here. When I attempted this Kata, I assumed that it was for beginners which is not the case.