Question
A library migration renamed every tag. You are given two equal-length lists: old_tags[i] is a tag before the migration and new_tags[i] is what that same item shows now. The migration is trustworthy only if it renamed consistently — every occurrence of a given old tag became one single new tag. Two different old tags are allowed to merge into the same new tag. Return true when the recorded pairs are consistent, false otherwise. For example, old ["a", "a"] with new ["b", "c"] is inconsistent, but old ["a", "b"] with new ["c", "c"] is fine.
consistent_rename(old_tags: list[str], new_tags: list[str]) → bool[["indie","lofi","indie"],["chill","calm","chill"]]outtrue[["a","a"],["b","c"]]outfalseState 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.