Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    you helped me. Thanks

  • Default User Avatar

    And I like how I was stuck this whole time until I read your comment. My code kept getting timed out because of these summations.
    Thanks mate !

  • Custom User Avatar

    My bad, in JS, arrays can contain up to 800,000 elements, I guess I must have looked at the tests in another language. However, the rest of my original response remains valid.

  • Custom User Avatar

    i used console.log to show me the array that given and it was so long in the end writed "... and 162821 item more"
    check the photo https://ibb.co/sPSvm56

  • Custom User Avatar

    There are no inputs with length greater than 60,000 . However, if your code times out, you must find a more efficient approach. Naive solutions won't pass this kata.

  • Custom User Avatar

    i made a code its work but with last test its give me timeout because the input is like 200k numbers any idea how to fix it?

  • Default User Avatar

    Made three solutions and only the last was sucsessful during basic tests, took several hours in two days to find out the most optimized one :)

  • Custom User Avatar

    I like how the kata leads you to a suggestion (summing) only for it to be the most inefficient way of solving the problem :)

  • Custom User Avatar
    • Ruby 3.0 should be enabled (Refer this & this for more detail)
  • Custom User Avatar

    I agree, some of the Kata's are really easy in some languages and rediculously hard in other langauages.
    It is a shame that kata ranks can be language dependent.

  • Custom User Avatar

    @Adrian1707 Well, Thanks Adrian for posting

    Why do my test cases pass on an individual basis but fail as a group?

    • I think you've come up with a solution that is fitting the Sample test cases But not the Random Ones , So you might have omitted Calculating an Expression that leads to a greater value :wink:
    • also For more Help, you can post your code here under Spoiler Flag so not to reveal any pieces of information, this will allow SQL Coders to catch a bug or so , Tuned to hear from you .. regards .. Zizou
  • Custom User Avatar

    I'm doing this in SQL and it's not as clear from the description what the end result should be and how the test runner works.
    I do have the answers but they're formatted as a single column table. When I attempt to return a single value then the tests fail because it contradicts what is expected in another test.

    So just to confirm: For the SQL version are we expected to return a final value, and if so then I think the test runner has to change to accomodate this

  • Default User Avatar

    Check the scope of all your variables. Behaviour like this usually indicates some value is persisting between method calls.

  • Custom User Avatar

    Why do my test cases pass on an individual basis but fail as a group? My logic is correct and every one of them passes, but when I run them all together there seems to be a weird ordering dependency going on

  • Loading more items...