Ad
  • Custom User Avatar

    It's short, but it's pretty slow. The ort fonction has a complexity of O(NlogN), where as you can resolve this is O(N) just by going through the list once and comparing elements two by two.

  • Custom User Avatar

    Ends up my first solution was extremely convoluted. I solved it a simpler way and it worked just fine.

  • Default User Avatar

    Same here. I thought my code just sucked that bad, haha.

  • Custom User Avatar

    I'm getting the exact same problem as well. And I can't figure out why.

    Edit: Ended up looking at the solutions - I had overcomplicated my code so there were too many calculations being made when the answer was much simpler.

  • Custom User Avatar

    I'm having a problem when submitting in python. I pass all of the test cases, no problem but then when I go to submit I'm getting this:

    'Process was terminated. It took longer than 6000ms to complete'

    Anyone else experiencing this issue? I am given no other information... Should I post my code here?