Ad
  • Custom User Avatar

    Please, put spoiler tag next time you post your code.

  • Custom User Avatar

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

  • Custom User Avatar

    hm same problem and I am checking for every version of empty or null. I can't check length because it throws an error that says you can't check length for null. I know the code works. it solves 114 of the random cases. There is just some way that I am throwing an error on a single testcase for submit despite the fact that I am checking for every variation there is on an empty array. I know this is just some stupid oversight on my part but I can imagine what it is.

  • Custom User Avatar

    thanks much! makes perfect sense
    I'll give it another crack!

  • Custom User Avatar

    Hi!

    The random test cases do use very large arrays to test if the solution is efficient enough. If your code passes the initial tests and times out during the random ones, then it just means that your code is running slightly too slow. It isn't bad or broken at all, but you just need to rethink if you can make some parts faster.

  • Custom User Avatar

    Hi my code works super quickly for the tests but when I click on submit it gets through the first test cases and then says "Process was terminated. It took longer than 6000ms to complete". Which happens for me when my code is bad or broken. I am just confused as to why it is happening when the code seems to work otherwise. Maybe it is just that the random cases are far larger arrays and my code is too slow to handle them. Not sure but any feedback is greatly appreciated!