Ad
  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar

    Ia agree with dfgwze.

    The final test is confusing and wrong now.

    Should be test.assert_equals(db_sort(["Apple",46,"287",574,"Peach","3","69",78,"Grape","423"]),[46,78,574,"287", "3","423", "69","Apple","Grape","Peach"])

  • Default User Avatar

    that has first the

    People will fall off their chairs trying to read that.

    strings are strings

    this is not information. you mean to say that strings should be sorted lexicographically - say that instead.
    it might be supposed to be helpful in pointing out that '123' is a different value from 123 but that's not what it says. if you're going to be helpful, be clear and correct.
    it's also javascript specific, nobody else would ever mix these up.

    I propose the following replacement description:

    Simple enough this one - you will be given a non-empty list containing numbers and strings.
    Your job is to return a single list containing all the numbers sorted in ascending order followed by all the strings in lexicographical order.
    

    javascript test output is poorly / inconsistently quoted. example:

    Expected: '[0, 2, 2, \'Apple\', \'Banana\', \'Mango\', \'Orange\']', instead got: 'undefined'
    Expected: [3, 4, 5, '1', '2', '3', '9', 'kdli', 'skqpoa'], instead got: undefined
    Test Passed: Value == '[2, 3, 4, 5, 6]'
    

    Please prefer to format them such that they can be evaluated to obtain the original value.

  • Custom User Avatar

    Agreed. Alphabetical sort for numbers will not work in test case witch is missleading when reading the subject.

  • Default User Avatar

    Attempt cases doesn't include a test case similar to last test case in which numbers are as strings. So even if that constraint hasn't been met succesfully, still we can pass the Kata. So, the Attempt cases should includesuch test cases as well.

  • Default User Avatar

    Kata was good! I just felt that nb(25,1) example caused a bit of confusion. I understand that its been stated 'numbers of interest', but it would be better if all the numbers would have listed and then counting no. of d from their squared forms.

  • Default User Avatar

    Please provide bit more detail regarding the mathematics behind it as in why water * 1.1 ^ (clothes - load).
    Hope this helps!

  • Default User Avatar

    In the second para of the description, clothes and load should be interchanged. That's the major edit needed.

  • Default User Avatar

    I got the same issue, just simplify your nested loops to bring down the complexity.

  • Default User Avatar

    In some of the python versions, str.maketrans won't work. In those instances, import string and then use string.maketrans