GoLang Solution For LeetCode Problem: Complex Number Multiplication
Solving Complex Number Multiplication in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.
Input: "1+1i", "1+1i" Output: "0+2i" Explanation: (1 + i) * (1 + i) = 1 + i2 + 2 * i = 2i, and you need convert it to the form of 0+2i.
Input: "1+-1i", "1+-1i" Output: "0+-2i" Explanation: (1 - i) * (1 - i) = 1 + i2 - 2 * i = -2i, and you need convert it to the form of 0+-2i.
- The input strings will not have extra blank.
See the full details of the problem Complex Number Multiplication at LeetCode
Originally posted at: @github.com/halfrost/LeetCode-Go