/**
 * Given a string and a set of sets, create a tuple from the string
 * and then loop through each set using a for loop.
 *
 * @param string The input string.
 * @param sets A list of sets.
 * @return The tuple created from the string.
 *
 * Example:
 * createTupleAndLoopThroughSets("hello world", setOf(setOf(1, 2), setOf(2, 3), setOf(4, 5)))
 * Output:
 * ('hello', 'world')
 * 1
 * 2
 * 2
 * 3
 * 4
 * 5
 */
fun createTupleAndLoopThroughSets(string: String, sets: List<Set<Int>>): Pair<String, String> {

    // Create a tuple from the string
    // Splitting the string on spaces
    val stringTuple = string.split(" ").toTypedArray().let { Pair(it[0], it[1]) }

    // Loop through each set
    for (set in sets) {
        // Loop through each element in the set
        for (element in set) {
            println(element)
        }
    }

    return stringTuple
}
/**
 * Given a string and a set of sets, create a tuple from the string
 * and then loop through each set using a for loop.
 *
 * @param string The input string.
 * @param sets A list of sets.
 * @return The tuple created from the string.
 *
 * Example:
 * createTupleAndLoopThroughSets("hello world", setOf(setOf(1, 2), setOf(2, 3), setOf(4, 5)))
 * Output:
 * ('hello', 'world')
 * 1
 * 2
 * 2
 * 3
 * 4
 * 5
 */
fun createTupleAndLoopThroughSets(string: String, sets: List<Set<Int>>): Pair<String, String> {
/**
 * Given a string and a set of sets, create a tuple from the string
 * and then loop through each set using a for loop.
 *
 * @param string The input string.
 * @param sets A list of sets.
 * @return The tuple created from the string.
 *
 * Example:
 * createTupleAndLoopThroughSets("hello world", setOf(setOf(1, 2), setOf(2, 3), setOf(4, 5)))
 * Output:
 * ('hello', 'world')
 * 1
 * 2
 * 2
 * 3
 * 4
 * 5
 */
fun createTupleAndLoopThroughSets(string: String, sets: List<Set<Int>>): Pair<String, String> {

    // Create a tuple from the string
    // Splitting the string on spaces
    val stringTuple = string.split(" ").toTypedArray().let { Pair(it[0], it[1]) }

    // Loop through each set
    for (set in sets) {
        // Loop through each element in the set
        for (element in set) {
            println(element)
        }
    }

    return stringTuple
}