Complex Numbers Sum

Published by Mubashir Hassan in

Mubashir needs your help in his maths homework.

Create a function which takes an array of Complex Numbers and returns the sum as a string.

Examples

sum_complex(["2+3i", "3-i"]) ➞ "5+2i"

sum_complex(["1", "1"]) ➞ "2"

sum_complex(["i", "2i", "3i"]) ➞ "6i"

Notes

N/A

Watch a quick demo on how Edabit works.