Ad
  • Custom User Avatar

    I had the same issue at first. Did you include: " if( h <= 0 || bounce >= 1 || bounce <= 0 || window >= h) return -1" I think my innefficiency at first was coming from not including it and the code getting stuck on a test case that I didnt check for in the above line of code.

  • Custom User Avatar

    I tried this exact solution and the server responded that the algorithm was way too inefficient. I understand it's not the optimal approach, but is the performance of this snippet so so so terrible?