Ad
  • Custom User Avatar

    There are 20000 JS tests in total, your code handles about half of them, I have run it several times - the result is 10_000 - 12_000. To be honest, I haven't looked closely at your code and can't tell you exactly what the problem is, but your algorithm needs to be improved. However, before you change anything, maybe you can add caching for some “heavy” calculations (if there are any and it is possible), it might work.