Code RoomClassification accuracy percent
EasyPrep Room Coding #524

Classification accuracy percent

CodingML systemsAlgorithms & data structuresEntry–Mid~10 min

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.

Implement
accuracy_percent(y_true: list[int], y_pred: list[int]) → int
Examples
in[[1,0,2,1],[1,0,1,1]]out75
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

0:00 of about 10 min
InputExpectedGot
[[1,0,2,1],[1,0,1,1]]75not run yetsample