/**
 * This exercise requires accessing elements in a list using the range function.
 *
 * Write a Kotlin function called 'accessElements" that takes three integers as arguments:
 * - 'rangeStart`: the start value for the range.
 * - 'rangeEnd`: the end value for the range (inclusive).
 * - 'elementIndex`: the index of the element to be accessed.
 *
 * The function should create a list containing all the integers in the given range (including both the start and end values).
 * Then, it should return the element at the specified index in the created list.
 *
 * Example:
 * accessElements(1, 10, 3) --> 4
 *
 * Explanation:
 * The function will create a list [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] using the range function.
 * The element at index 3 is 4, so the function returns 4.
 */
fun accessElements(rangeStart: Int, rangeEnd: Int, elementIndex: Int): Int {

    val list = (rangeStart..rangeEnd).toList()
    return list[elementIndex]
}
/**
 * This exercise requires accessing elements in a list using the range function.
 *
 * Write a Kotlin function called 'accessElements" that takes three integers as arguments:
 * - 'rangeStart`: the start value for the range.
 * - 'rangeEnd`: the end value for the range (inclusive).
 * - 'elementIndex`: the index of the element to be accessed.
 *
 * The function should create a list containing all the integers in the given range (including both the start and end values).
 * Then, it should return the element at the specified index in the created list.
 *
 * Example:
 * accessElements(1, 10, 3) --> 4
 *
 * Explanation:
 * The function will create a list [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] using the range function.
 * The element at index 3 is 4, so the function returns 4.
 */
fun accessElements(rangeStart: Int, rangeEnd: Int, elementIndex: Int): Int {
/**
 * This exercise requires accessing elements in a list using the range function.
 *
 * Write a Kotlin function called 'accessElements" that takes three integers as arguments:
 * - 'rangeStart`: the start value for the range.
 * - 'rangeEnd`: the end value for the range (inclusive).
 * - 'elementIndex`: the index of the element to be accessed.
 *
 * The function should create a list containing all the integers in the given range (including both the start and end values).
 * Then, it should return the element at the specified index in the created list.
 *
 * Example:
 * accessElements(1, 10, 3) --> 4
 *
 * Explanation:
 * The function will create a list [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] using the range function.
 * The element at index 3 is 4, so the function returns 4.
 */
fun accessElements(rangeStart: Int, rangeEnd: Int, elementIndex: Int): Int {

    val list = (rangeStart..rangeEnd).toList()
    return list[elementIndex]
}