Compare config equivalence
Two engineers swear their laptops run "the same settings". Decide it. You get both files as lists of lines. Cosmetic differences must not matter: ordering of lines, spacing around the first "=", blank lines, and "#" comment lines are all irrelevant, and when a name is assigned repeatedly only its final assignment speaks. A line containing no "=" at all is noise and speaks for nothing. Return true exactly when both files define the same set of names with the same final values.
Implement
same_config(a: list[str], b: list[str]) → boolExamples
in
[["a=1","b = 2"],["b=2","a=1","a=1"]]outtrueWhat 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 11 min
solution.py
InputExpectedGot
[["a=1","b = 2"],["b=2","a=1","a=1"]]truenot run yetsample