/**
 * This exercise requires implementing a function that subtracts individual elements of two vectors.
 *
 * @param vector1 The first vector.
 * @param vector2 The second vector.
 * @return A new list containing the difference between the individual elements of the vectors.
 *
 * Example:
 * subtractElements(listOf(1, 2, 3), listOf(4, 5, 6)) -> [-3, -3, -3]
 */
fun subtractElements(vector1: List<Int>, vector2: List<Int>): List<Int> {

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

    // Check if the vectors have the same length
    if (vector1.size != vector2.size) {
        return listOf(-1) // Error: Vectors must have the same length.
    }

    // Subtract individual elements and append the difference to the result list
    for (i in vector1.indices) {
        result.add(vector1[i] - vector2[i])
    }

    return result
}
/**
 * This exercise requires implementing a function that subtracts individual elements of two vectors.
 *
 * @param vector1 The first vector.
 * @param vector2 The second vector.
 * @return A new list containing the difference between the individual elements of the vectors.
 *
 * Example:
 * subtractElements(listOf(1, 2, 3), listOf(4, 5, 6)) -> [-3, -3, -3]
 */
fun subtractElements(vector1: List<Int>, vector2: List<Int>): List<Int> {
/**
 * This exercise requires implementing a function that subtracts individual elements of two vectors.
 *
 * @param vector1 The first vector.
 * @param vector2 The second vector.
 * @return A new list containing the difference between the individual elements of the vectors.
 *
 * Example:
 * subtractElements(listOf(1, 2, 3), listOf(4, 5, 6)) -> [-3, -3, -3]
 */
fun subtractElements(vector1: List<Int>, vector2: List<Int>): List<Int> {

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

    // Check if the vectors have the same length
    if (vector1.size != vector2.size) {
        return listOf(-1) // Error: Vectors must have the same length.
    }

    // Subtract individual elements and append the difference to the result list
    for (i in vector1.indices) {
        result.add(vector1[i] - vector2[i])
    }

    return result
}