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

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

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

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

Notes

N/A

Watch a quick demo on how Edabit works.