Ad
  • Custom User Avatar

    No reason behind. But Javascript does have a Issue with the sorting algorithm if revenue is the same. so we included it into the Testcases.

  • Custom User Avatar

    @fnbro why make up new fixed tests cases rather than use the same ones from the Python translation? There's no point in test suite disparity between the two languages.

  • Custom User Avatar

    Why are your tests different between JS and Python translations? The translations have different sets of fixed tests...

  • Custom User Avatar

    Yeah, that's strange... because I just ran my code in browser and it works great
    Don't know why it returns different arrays here and in my console...
    P.S. And my code works perfectly in Codepen too
    Thanks for the answer anyway, I guess I should just skip this kata..

  • Custom User Avatar

    My code returns [ "Tablets", "Music CDs", "Speakers" ]

    It doesn't, have you read the error message?

  • Custom User Avatar

    The question is same.
    My code returns [ "Tablets", "Music CDs", "Speakers" ].
    -Because Speakers goes BEFORE Keyboards.
    -In my answer Speakers goes BEFORE keyboards
    -This is their ORIGINAL positions.
    Why in the world would test expect KEYBOARDS?

  • Custom User Avatar

    "Speakers" goes before "Keyboards"

    expected [..., "Keyboards"] to deeply equal [..., "Speakers"]

    And what's the question? Your logic is correct, the only thing that's left is to make your code correct too.

  • Custom User Avatar

    So, I have these arguments in my JavaScript function:
    products: [ 'Tablets', 'Computer', 'Vacuum Cleaner', 'Mouses', 'Scooter', 'TVs', 'Speakers', 'Keyboards', 'Printer', 'Games', 'Chargers', 'Cell Phones', 'Music CDs', 'Drones' ]
    amounts: [ 40, 27, 12, 3, 12, 44, 22, 44, 17, 13, 1, 19, 22, 19 ]
    prices: [ 88, 66, 67, 63, 61, 6, 84, 42, 1, 22, 68, 72, 94, 24 ]
    And the test expected [ 'Tablets', 'Music CDs', 'Keyboards' ] to deeply equal [ 'Tablets', 'Music CDs', 'Speakers' ]
    Keyboards and Speakers has the same revenue: 1848, and you requested order them according to their original positions.
    Speakers goes before Keyboards in input parameters. So wtf does this thing want?

  • Custom User Avatar

    Oh, sure, I forget about bills I can't split
    Thanks

  • Custom User Avatar

    Read the instructions again and some of the many posts down here. Also, the log appears above the test result, so it seems you're confusing the result of one test with the log of the next one.

  • Custom User Avatar

    'YES' should equal 'NO'

    Log
    [25, 50, 100, 25, 25, 25, 50]
    25
    25
    not enough cash
    NO

    Sorry, what
    My result IS 'no', but ofc 'yes' should equals 'no'

  • Default User Avatar

    Sorry, you're right, I had misread the instructions. Thanks!

  • Custom User Avatar

    yes, he asked same question two places, (already answered), the test is correct

  • Custom User Avatar

    Try with this:

    package kata
    
    import ("fmt")
    
    func Tickets(peopleInLine []int) string {
      fmt.Printf("%v", peopleInLine)
      // your code here
    }
    
  • Default User Avatar

    is there any way to see the input in the failed tests?
    I havent found a way to see them in Go

  • Loading more items...