/**
 * This function takes two arrays and multiplies each element
 * in the first array by the corresponding element in the second
 * array using nested loops and the multiplication assignment
 * operator.
 *
 * @param array1 The first array containing integers
 * @param array2 The second array containing integers
 * @return The array containing the multiplied values
 *
 * Example:
 * Input:
 * array1 = [1, 2, 3]
 * array2 = [4, 5, 6]
 *
 * Output:
 * result = [4, 10, 18]
 */
fun multiplyArrays(array1: IntArray, array2: IntArray): IntArray {

    val result = mutableListOf<Int>()  // Initialize an empty list to store the multiplied values

    // Iterate through each element in array1
    for (num1 in array1) {
        var temp = num1

        // Iterate through each element in array2
        for (num2 in array2) {
            // Multiply num1 and num2
            temp *= num2
        }

        // Append the multiplied value to the result array
        result.add(temp)
    }

    return result.toIntArray()
}
/**
 * This function takes two arrays and multiplies each element
 * in the first array by the corresponding element in the second
 * array using nested loops and the multiplication assignment
 * operator.
 *
 * @param array1 The first array containing integers
 * @param array2 The second array containing integers
 * @return The array containing the multiplied values
 *
 * Example:
 * Input:
 * array1 = [1, 2, 3]
 * array2 = [4, 5, 6]
 *
 * Output:
 * result = [4, 10, 18]
 */
fun multiplyArrays(array1: IntArray, array2: IntArray): IntArray {
/**
 * This function takes two arrays and multiplies each element
 * in the first array by the corresponding element in the second
 * array using nested loops and the multiplication assignment
 * operator.
 *
 * @param array1 The first array containing integers
 * @param array2 The second array containing integers
 * @return The array containing the multiplied values
 *
 * Example:
 * Input:
 * array1 = [1, 2, 3]
 * array2 = [4, 5, 6]
 *
 * Output:
 * result = [4, 10, 18]
 */
fun multiplyArrays(array1: IntArray, array2: IntArray): IntArray {

    val result = mutableListOf<Int>()  // Initialize an empty list to store the multiplied values

    // Iterate through each element in array1
    for (num1 in array1) {
        var temp = num1

        // Iterate through each element in array2
        for (num2 in array2) {
            // Multiply num1 and num2
            temp *= num2
        }

        // Append the multiplied value to the result array
        result.add(temp)
    }

    return result.toIntArray()
}