/**
 * This exercise tests your ability to use the greater than operator and slicing in Kotlin.
 *
 * Given a list of numerical data and a threshold value, you need to write code that returns a new list
 * containing only the elements from the original list that are greater than the threshold, and only includes
 * their last three characters.
 *
 * @param data_list A list of numerical data.
 * @param threshold A numerical value representing the threshold.
 * @return A new list containing only the last three characters of elements greater than the threshold.
 *
 * Example:
 * greaterThanAndSlicing(listOf(12, 34, 56, 78, 91, 123, 456, 789), 50) -> listOf("123", "456", "789")
 */
fun greaterThanAndSlicing(dataList: List<Int>, threshold: Int): List<String> {

    val newList = mutableListOf<String>()
    
    for (data in dataList) {
        if (data > threshold) {
            val stringData = data.toString()
            newList.add(stringData.takeLast(3))
        }
    }
    
    return newList
}
/**
 * This exercise tests your ability to use the greater than operator and slicing in Kotlin.
 *
 * Given a list of numerical data and a threshold value, you need to write code that returns a new list
 * containing only the elements from the original list that are greater than the threshold, and only includes
 * their last three characters.
 *
 * @param data_list A list of numerical data.
 * @param threshold A numerical value representing the threshold.
 * @return A new list containing only the last three characters of elements greater than the threshold.
 *
 * Example:
 * greaterThanAndSlicing(listOf(12, 34, 56, 78, 91, 123, 456, 789), 50) -> listOf("123", "456", "789")
 */
fun greaterThanAndSlicing(dataList: List<Int>, threshold: Int): List<String> {
/**
 * This exercise tests your ability to use the greater than operator and slicing in Kotlin.
 *
 * Given a list of numerical data and a threshold value, you need to write code that returns a new list
 * containing only the elements from the original list that are greater than the threshold, and only includes
 * their last three characters.
 *
 * @param data_list A list of numerical data.
 * @param threshold A numerical value representing the threshold.
 * @return A new list containing only the last three characters of elements greater than the threshold.
 *
 * Example:
 * greaterThanAndSlicing(listOf(12, 34, 56, 78, 91, 123, 456, 789), 50) -> listOf("123", "456", "789")
 */
fun greaterThanAndSlicing(dataList: List<Int>, threshold: Int): List<String> {

    val newList = mutableListOf<String>()
    
    for (data in dataList) {
        if (data > threshold) {
            val stringData = data.toString()
            newList.add(stringData.takeLast(3))
        }
    }
    
    return newList
}