/**
 * This function takes in start and stop parameters to create a range of numbers
 * and then performs string slicing on the given string using the created range.
 *
 * @param start The starting value of the range.
 * @param stop The ending value of the range.
 * @param string The string to be sliced.
 * @param indexRange The range of indices for string slicing.
 * @return The sliced string based on the given range.
 */
fun createRangeAndSliceString(start: Int, stop: Int, string: String, indexRange: Pair<Int, Int>): String {

    // Creating a range of numbers using start and stop parameters
    val numbers = (start until stop).toList()

    // Converting the numbers to a string
    val numbersStr = numbers.joinToString("")

    // Slicing the given string using the indexRange
    val slicedString = string.substring(indexRange.first, indexRange.second)

    // Concatenating the sliced string with the numbers string
    val result = numbersStr + slicedString

    return result
}
/**
 * This function takes in start and stop parameters to create a range of numbers
 * and then performs string slicing on the given string using the created range.
 *
 * @param start The starting value of the range.
 * @param stop The ending value of the range.
 * @param string The string to be sliced.
 * @param indexRange The range of indices for string slicing.
 * @return The sliced string based on the given range.
 */
fun createRangeAndSliceString(start: Int, stop: Int, string: String, indexRange: Pair<Int, Int>): String {
/**
 * This function takes in start and stop parameters to create a range of numbers
 * and then performs string slicing on the given string using the created range.
 *
 * @param start The starting value of the range.
 * @param stop The ending value of the range.
 * @param string The string to be sliced.
 * @param indexRange The range of indices for string slicing.
 * @return The sliced string based on the given range.
 */
fun createRangeAndSliceString(start: Int, stop: Int, string: String, indexRange: Pair<Int, Int>): String {

    // Creating a range of numbers using start and stop parameters
    val numbers = (start until stop).toList()

    // Converting the numbers to a string
    val numbersStr = numbers.joinToString("")

    // Slicing the given string using the indexRange
    val slicedString = string.substring(indexRange.first, indexRange.second)

    // Concatenating the sliced string with the numbers string
    val result = numbersStr + slicedString

    return result
}