Question
Implement the extended Euclidean algorithm: given non-negative integers a and b (not both zero, each <= 10^9), return [g, x, y] where g = gcd(a, b) and x, y are Bezout coefficients satisfying a*x + b*y = g. Among the infinitely many (x, y), return the canonical pair produced by the standard recursive/iterative extended-Euclid (the one with the smallest |x| that the textbook algorithm yields).
ext_gcd(a: int, b: int) → list[int][240,46]out[2,-9,47]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.