/**
 * This exercise requires an understanding of negative indexing and concatenation in Kotlin.
 *
 * Given two arrays, your task is to return a new array that contains the elements from both arrays,
 * with the elements of the first array reversed and concatenated with the elements of the second array.
 *
 * Example:
 * Input:
 * array1 = intArrayOf(1, 2, 3, 4, 5)
 * array2 = intArrayOf(6, 7, 8, 9, 10)
 *
 * Output:
 * [5, 4, 3, 2, 1, 6, 7, 8, 9, 10]
 */
fun economistNegativeIndexingConcatenation(array1: IntArray, array2: IntArray): IntArray {

    // Reverse the elements of array1
    val reversedArray1 = array1.reversedArray()

    // Concatenate the reversed array1 with array2
    val combinedArray = reversedArray1 + array2

    return combinedArray
}
/**
 * This exercise requires an understanding of negative indexing and concatenation in Kotlin.
 *
 * Given two arrays, your task is to return a new array that contains the elements from both arrays,
 * with the elements of the first array reversed and concatenated with the elements of the second array.
 *
 * Example:
 * Input:
 * array1 = intArrayOf(1, 2, 3, 4, 5)
 * array2 = intArrayOf(6, 7, 8, 9, 10)
 *
 * Output:
 * [5, 4, 3, 2, 1, 6, 7, 8, 9, 10]
 */
fun economistNegativeIndexingConcatenation(array1: IntArray, array2: IntArray): IntArray {
/**
 * This exercise requires an understanding of negative indexing and concatenation in Kotlin.
 *
 * Given two arrays, your task is to return a new array that contains the elements from both arrays,
 * with the elements of the first array reversed and concatenated with the elements of the second array.
 *
 * Example:
 * Input:
 * array1 = intArrayOf(1, 2, 3, 4, 5)
 * array2 = intArrayOf(6, 7, 8, 9, 10)
 *
 * Output:
 * [5, 4, 3, 2, 1, 6, 7, 8, 9, 10]
 */
fun economistNegativeIndexingConcatenation(array1: IntArray, array2: IntArray): IntArray {

    // Reverse the elements of array1
    val reversedArray1 = array1.reversedArray()

    // Concatenate the reversed array1 with array2
    val combinedArray = reversedArray1 + array2

    return combinedArray
}