Code Room
CodingEasycod-g1351
Subject Ml metricsLevel Entry–Mid~12 minCommon in ML systems · Algorithms & data structures interviewsIndustries Software development

Question

You are scoring a chatbot's short answers against a reference answer key using normalized exact match. Given equal-length lists outputs and references, normalize each string by lowercasing it, trimming leading and trailing whitespace, and collapsing every internal run of whitespace to a single space. Return the number of positions where the normalized output equals the normalized reference. Example: outputs = [" Paris ", "london"], references = ["paris", "Berlin"] returns 1.

Implement
exact_match_count(outputs: list[str], references: list[str]) → int
Examples
in[[" Paris ","london"],["paris","Berlin"]]out1
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.

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.