/**
 * This function takes in a real and imaginary part of a complex number and returns its string representation.
 *
 * @param real The real part of the complex number.
 * @param imaginary The imaginary part of the complex number.
 * @return The string representation of the complex number.
 *
 * Example:
 * complexNumberRepresentation(2, 3) -> "2+3j"
 * complexNumberRepresentation(-1, 0) -> "-1"
 * complexNumberRepresentation(0, -5) -> "-5j"
 */
fun complexNumberRepresentation(real: Double, imaginary: Double): String {

    return when {
        real == 0.0 && imaginary == 0.0 -> "0"
        real != 0.0 && imaginary == 0.0 -> real.toString()
        real == 0.0 && imaginary != 0.0 -> "${imaginary}j"
        imaginary > 0 -> "${real}+${imaginary}j"
        else -> "${real}${imaginary}j"
    }
}
/**
 * This function takes in a real and imaginary part of a complex number and returns its string representation.
 *
 * @param real The real part of the complex number.
 * @param imaginary The imaginary part of the complex number.
 * @return The string representation of the complex number.
 *
 * Example:
 * complexNumberRepresentation(2, 3) -> "2+3j"
 * complexNumberRepresentation(-1, 0) -> "-1"
 * complexNumberRepresentation(0, -5) -> "-5j"
 */
fun complexNumberRepresentation(real: Double, imaginary: Double): String {
/**
 * This function takes in a real and imaginary part of a complex number and returns its string representation.
 *
 * @param real The real part of the complex number.
 * @param imaginary The imaginary part of the complex number.
 * @return The string representation of the complex number.
 *
 * Example:
 * complexNumberRepresentation(2, 3) -> "2+3j"
 * complexNumberRepresentation(-1, 0) -> "-1"
 * complexNumberRepresentation(0, -5) -> "-5j"
 */
fun complexNumberRepresentation(real: Double, imaginary: Double): String {

    return when {
        real == 0.0 && imaginary == 0.0 -> "0"
        real != 0.0 && imaginary == 0.0 -> real.toString()
        real == 0.0 && imaginary != 0.0 -> "${imaginary}j"
        imaginary > 0 -> "${real}+${imaginary}j"
        else -> "${real}${imaginary}j"
    }
}