/**
 * Given a list and an integer n, return the last n elements of the list.
 *
 * @param inputList A list of elements.
 * @param n An integer representing the number of elements to return.
 * @return A list containing the last n elements from inputList.
 *
 * Example:
 * get_last_n_elements(listOf(1, 2, 3, 4, 5), 3) -> [3, 4, 5]
 * get_last_n_elements(listOf("a", "b", "c", "d", "e"), 2) -> ["d", "e"]
 */
fun getLastNElements(inputList: List<Any>, n: Int): List<Any> {

    // Use subList to obtain the last n elements of the input list
    return inputList.takeLast(n)
}
/**
 * Given a list and an integer n, return the last n elements of the list.
 *
 * @param inputList A list of elements.
 * @param n An integer representing the number of elements to return.
 * @return A list containing the last n elements from inputList.
 *
 * Example:
 * get_last_n_elements(listOf(1, 2, 3, 4, 5), 3) -> [3, 4, 5]
 * get_last_n_elements(listOf("a", "b", "c", "d", "e"), 2) -> ["d", "e"]
 */
fun getLastNElements(inputList: List<Any>, n: Int): List<Any> {
/**
 * Given a list and an integer n, return the last n elements of the list.
 *
 * @param inputList A list of elements.
 * @param n An integer representing the number of elements to return.
 * @return A list containing the last n elements from inputList.
 *
 * Example:
 * get_last_n_elements(listOf(1, 2, 3, 4, 5), 3) -> [3, 4, 5]
 * get_last_n_elements(listOf("a", "b", "c", "d", "e"), 2) -> ["d", "e"]
 */
fun getLastNElements(inputList: List<Any>, n: Int): List<Any> {

    // Use subList to obtain the last n elements of the input list
    return inputList.takeLast(n)
}