Annotator disagreement indices

Write codeEasy10 minAnthropic and OpenAI style

Your task

Two human annotators labeled the same batch of chat messages for a moderation training set, and the data lead wants to review every message they disagreed on. Given two equal-length lists of string labels, annotator_a and annotator_b, return the list of indices (0-based, in increasing order) where the two labels differ. Comparison is exact and case-sensitive. Example: annotator_a = ["ok", "toxic", "ok"], annotator_b = ["ok", "ok", "ok"] gives [1].

Examples

disagreement_indices(annotator_a: list[str], annotator_b: list[str]) -> list[int]
Example 1
Inputdisagreement_indices(["ok", "toxic", "ok"], ["ok", "ok", "ok"])
Output[1]