/**
 * Given a string and a delimiter, create a list of tuples where each tuple contains two elements:
 * the index of the string in the list and the reversed string.
 *
 * @param strings A string consisting of multiple words separated by the delimiter.
 * @param delimiter The character used to separate the words in the input string.
 * @return A list of tuples containing the index of the word and its reverse.
 *
 * Example:
 * createTuples("hello world my name is", " ") => [(0, 'olleh'), (1, 'dlrow'), (2, 'ym'), (3, 'eman'), (4, 'si')]
 */
fun createTuples(strings: String, delimiter: String): List<Pair<Int, String>> {

    val words = strings.split(delimiter)
    val tuples = mutableListOf<Pair<Int, String>>()
    for ((index, word) in words.withIndex()) {
        tuples.add(index to word.reversed())
    }
    return tuples
}
/**
 * Given a string and a delimiter, create a list of tuples where each tuple contains two elements:
 * the index of the string in the list and the reversed string.
 *
 * @param strings A string consisting of multiple words separated by the delimiter.
 * @param delimiter The character used to separate the words in the input string.
 * @return A list of tuples containing the index of the word and its reverse.
 *
 * Example:
 * createTuples("hello world my name is", " ") => [(0, 'olleh'), (1, 'dlrow'), (2, 'ym'), (3, 'eman'), (4, 'si')]
 */
fun createTuples(strings: String, delimiter: String): List<Pair<Int, String>> {
/**
 * Given a string and a delimiter, create a list of tuples where each tuple contains two elements:
 * the index of the string in the list and the reversed string.
 *
 * @param strings A string consisting of multiple words separated by the delimiter.
 * @param delimiter The character used to separate the words in the input string.
 * @return A list of tuples containing the index of the word and its reverse.
 *
 * Example:
 * createTuples("hello world my name is", " ") => [(0, 'olleh'), (1, 'dlrow'), (2, 'ym'), (3, 'eman'), (4, 'si')]
 */
fun createTuples(strings: String, delimiter: String): List<Pair<Int, String>> {

    val words = strings.split(delimiter)
    val tuples = mutableListOf<Pair<Int, String>>()
    for ((index, word) in words.withIndex()) {
        tuples.add(index to word.reversed())
    }
    return tuples
}