Question
Given pairwise-coprime moduli and corresponding remainders, find the smallest non-negative x satisfying x = remainders[i] (mod moduli[i]) for all i, using the Chinese Remainder Theorem. Return a two-element list [x, M] where M is the product of all moduli and x is the unique solution in [0, M). Constraints: 1 to 10 congruences, each modulus 1 <= moduli[i] <= 1000, moduli are pairwise coprime, 0 <= remainders[i] < moduli[i].
crt(remainders: list[int], moduli: list[int]) → list[int][[2,3,2],[3,5,7]]out[23,105]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.