Best model by accuracy

Write codeMedium14 minOpenAI and Anthropic style

Your task

A weekly bake-off scores several candidate models on eval sets of different sizes, so comparing them by floored percentages is too coarse. Given results, a non-empty list where results[i] = [correct_i, total_i] with total_i >= 1, return the index of the model with the highest exact accuracy correct_i / total_i. Compare two models with integer cross-multiplication: model i beats model j when correct_i * total_j > correct_j * total_i. If several models tie for best, return the smallest index. Example: results = [[45, 50], [90, 100], [8, 10]] returns 0 (0.9 ties 0.9, earlier index wins).

Examples

best_model(results: list[list[int]]) -> int
Example 1
Inputbest_model([[45, 50], [90, 100], [8, 10]])
Output0