deno.land / x / masx200_leetcode_test@10.6.5 / complex-number-multiplication / index.ts
123456789101112131415import { parseComplex } from "./parse_complex.ts";
function complexNumberMultiply(num1: string, num2: string): string { const { real: real1, imag: imag1 } = parseComplex(num1); const { real: real2, imag: imag2 } = parseComplex(num2); return [ real1 * real2 - imag1 * imag2, "+", real1 * imag2 + imag1 * real2, "i", ].join("");}
export default complexNumberMultiply;
Version Info