Quadratic uniqueness check
Review this Python function that returns unique records preserving order.
What a strong answer looks like
Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix, specific and kind.
0:00 of about 18 min
Mark a line and say what kind of problem it is.0 findings
1def unique(records):
2 result = []
3 for r in records:
4 is_dup = False
5 for seen in result: # scan everything kept so far
6 if seen.key == r.key:
7 is_dup = True
8 break
9 if not is_dup:
10 result.append(r)
11 return result
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.
Run or narrate your approach, then ask the coach.