Question
You are given two equal-length lists, remainders and moduli, describing a system of congruences x ≡ remainders[i] (mod moduli[i]) for each i. The moduli are positive but NOT necessarily pairwise coprime. Return the smallest non-negative x satisfying all congruences, or -1 if the system is inconsistent. For example, x ≡ 2 (mod 3), x ≡ 3 (mod 5), x ≡ 2 (mod 7) yields 23. All values fit in 64-bit integers.
crt(remainders: list[int], moduli: list[int]) → int[[2,3,2],[3,5,7]]out23State 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.