Ad
  • Custom User Avatar

    The task in Java seems to work well, and I believe you are handling some edge case incorrectly.

    Check if you account for this part of the description:

    Three conditions must be met for a valid experiment:

    • Float parameter "h" in meters must be greater than 0
    • Float parameter "bounce" must be greater than 0 and less than 1
    • Float parameter "window" must be less than h.

    If all three conditions above are fulfilled, return a positive integer, otherwise return -1.