Ad
  • Custom User Avatar

    It is Haskell. This is the fixed case he is talking about :

    countPositivesSumNegatives (Just [0])  `shouldBe` []
    

    But from the description you would expect this :

    countPositivesSumNegatives (Just [0])  `shouldBe` [0,0]
    

    I just looked at the code, it looks like a mistake in the reference solution which is recursive and calls itself as there is a check to return [] and it doesn't take into account that the sum of 0 + 0 == 0 .

    I can easily adjust the code to make it return [0,0] but that will break a lot (all?) solutions or I can just change the description to put in that weird edge case.

  • Custom User Avatar