Ad
  • Custom User Avatar

    it works, finally! :)

  • Custom User Avatar

    ty Giacomo it worked!

  • Custom User Avatar

    The random test cases were fixed, I forgot to check the basics: now is done!

  • Custom User Avatar

    ['-3->0'] should equal ['-2', '0', '-1', '-3->-2']. Please fix.

  • Custom User Avatar

    This problem still exists in the Ruby tests.

  • Custom User Avatar

    Fixed (or so I hope), sorry for the inconvenience!

  • Custom User Avatar

    same problem using Python
    ['-3->0'] should equal ['-2', '0', '-1', '-3->-2']

  • Custom User Avatar

    Arrays should be sorted. It is an oversight from the Python and Ruby translator. I will ask him to fix up the test cases. Thanks for reporting this.

  • Custom User Avatar

    I noticed that in Python too, some test inputs are not sorted. This contradicts the problem statement but it is possible to adjust solutions to cope with unsorted input easily enough.

    Perhaps the problem statement should be amended to indicated that the overall array is not necessarily sorted, but some ranges within the array are.

  • Custom User Avatar

    I think something may be wrong with the test cases. Using Ruby btw, the last two are very strange.
    Test Passed: Value == []
    Test Passed: Value == ["1"]
    Test Passed: Value == ["1->4"]
    Test Passed: Value == ["0->2", "5->6", "9"]
    Test Passed: Value == ["0->7"]
    Test Passed: Value == ["0->7"]
    Test Passed: Value == ["0->7", "9->10"]
    Test Passed: Value == ["-2", "0->7", "9->10", "12"]
    Expected: ["-2", "0", "-1", "-3->-2"], instead got: ["-2", "0"]
    Expected: ["-2", "0", "-1->0", "-1->0", "-1"], instead got: ["-2", "0"]

  • Custom User Avatar

    Such a nice and elegent solution. I always have this inkling that my code can be much cleaner. Well done.

  • Custom User Avatar