Skip to content

Commit 5397a2e

Browse files
authored
Update Complex Number Multiplication.java
1 parent c685fc7 commit 5397a2e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Medium/Complex Number Multiplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ public String complexNumberMultiply(String num1, String num2) {
33
int realPartOne = Integer.parseInt(num1.split("\\+")[0]);
44
int imaginaryPartOne = Integer.parseInt(num1.split("\\+")[1].substring(0, num1.split("\\+")[1].length() - 1));
55
int realPartTwo = Integer.parseInt(num2.split("\\+")[0]);
6-
int imaginaryPartTwo = Integer.parseInt(num2.split("\\+")[1].substring(0, num2.split("\\+")[1].length() - 1));
6+
int imaginaryPartTwo = Integer.parseInt(num2.split("\\+")[1].substring(0, num2.split("\\+")[1].length() - 1));
77
return (realPartOne * realPartTwo - imaginaryPartOne * imaginaryPartTwo) + "+" + (realPartOne * imaginaryPartTwo + realPartTwo * imaginaryPartOne) + "i";
88
}
99
}

0 commit comments

Comments
 (0)