Skip to content

Commit 100b63f

Browse files
committed
Day08
1 parent 26151f9 commit 100b63f

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

leetcode3/최민지/537.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class Solution:
2+
def complexNumberMultiply(self, num1: str, num2: str) -> str:
3+
real1, imag1 = map(int, num1[:-1].split("+"))
4+
real2, imag2 = map(int, num2[:-1].split("+"))
5+
result1 = real1 * real2 - imag1 * imag2
6+
result2 = real1 * imag2 + imag1 * real2
7+
return str(result1) + "+" + str(result2) + "i"
8+

0 commit comments

Comments
 (0)