a + bi is written as a string "a+bi", where a and b are integers. The + is always there, even when b is negative: 3 − 2i is written as "3+-2i", and −4 as "-4+0i".
Given two such strings first and second, multiply the numbers (remember that i² = −1) and return the product in the same format.first="2+3i", second="4+-1i" → '11+10i'
(2 + 3i)(4 − i) = 8 − 2i + 12i − 3i² = 8 + 3 + 10i = 11 + 10i.
first="0+2i", second="0+5i" → '-10+0i'
2i · 5i = 10i² = −10 with a zero imaginary part, written as -10+0i.
first="-3+0i", second="1+-7i" → '-3+21i'
−3 · (1 − 7i) = −3 + 21i.
"a+bi" formata, b ≤ 100 in each numberfirst="2+3i", second="4+-1i"
'11+10i'
Run checks the first 3 tests in your browser. Submit checks all 63 tests on the server, hidden ones included.