Minimum Time Required

  • + 0 comments

    Decent, but one error and one optimization. The error: in the while, the conditionals should be if count >= goal: worst = mid - 1 result = mid else: best = mid + 1 `

    The optimization: the mid calculation should be mid = (worst + best) // 2