Complex Number Multiplication
easy
1. A complex number can be represented as a string on the form "Real + Imaginary i" where: 1.1 Real is the real part and is an integer in the range [-100, 100]. 1.2 Imaginary is the imaginary part and is an integer in the range [-100, 100]. 1.3 i^2 == -1. 2. Given two complex numbers num1 and num2 as strings, return a string of the complex number that represents their multiplications.
Constraints
num1 and num2 are valid complex numbers.
Format
Input
1. num1 = "1+1i", num2 = "1+1i" 2. num1 = "1+-1i", num2 = "1+-1i"
Output
1. "0+2i" Explanation: (1 + i) * (1 + i) = 1 + i2 + 2 * i = 2i, and you need convert it to the form of 0+2i.
Example
Sample Input
1+1i
1+1i
Sample Output
0+2i