Classification accuracy percent

Write codeEasy10 minMeta style

Your task

A content-moderation model labels posts with integer category ids. The weekly report shows accuracy as a whole percent, rounded down. Given equal-length lists y_true and y_pred, count the positions where they agree and return floor(100 * correct / total) as an integer. If the lists are empty, return 0. Example: y_true = [1, 0, 2, 1], y_pred = [1, 0, 1, 1] has 3 of 4 correct, so return 75.

Examples

accuracy_percent(y_true: list[int], y_pred: list[int]) -> int
Example 1
Inputaccuracy_percent([1, 0, 2, 1], [1, 0, 1, 1])
Output75