/**
 * This function takes a chef's special string, and two indices as input. It concatenates the characters from index_1 to index_2
 * (inclusive) into a new string.
 *
 * @param chefString The chef's special string.
 * @param index1 The starting index for concatenation.
 * @param index2 The ending index for concatenation.
 * @return The new string formed after concatenating the characters from index_1 to index_2.
 */
fun chefStringIndexConcat(chefString: String, index1: Int, index2: Int): String {

    // Check if the provided indices are valid
    if (index1 < 0 || index2 < 0 || index1 >= chefString.length || index2 >= chefString.length) {
        return "Invalid indices provided!"
    }

    // Check if index2 is smaller than index1
    if (index1 > index2) {
        return "index1 should be smaller than or equal to index2!"
    }

    // Concatenate the characters from index1 to index2
    return chefString.substring(index1, index2 + 1)
}
/**
 * This function takes a chef's special string, and two indices as input. It concatenates the characters from index_1 to index_2
 * (inclusive) into a new string.
 *
 * @param chefString The chef's special string.
 * @param index1 The starting index for concatenation.
 * @param index2 The ending index for concatenation.
 * @return The new string formed after concatenating the characters from index_1 to index_2.
 */
fun chefStringIndexConcat(chefString: String, index1: Int, index2: Int): String {
/**
 * This function takes a chef's special string, and two indices as input. It concatenates the characters from index_1 to index_2
 * (inclusive) into a new string.
 *
 * @param chefString The chef's special string.
 * @param index1 The starting index for concatenation.
 * @param index2 The ending index for concatenation.
 * @return The new string formed after concatenating the characters from index_1 to index_2.
 */
fun chefStringIndexConcat(chefString: String, index1: Int, index2: Int): String {

    // Check if the provided indices are valid
    if (index1 < 0 || index2 < 0 || index1 >= chefString.length || index2 >= chefString.length) {
        return "Invalid indices provided!"
    }

    // Check if index2 is smaller than index1
    if (index1 > index2) {
        return "index1 should be smaller than or equal to index2!"
    }

    // Concatenate the characters from index1 to index2
    return chefString.substring(index1, index2 + 1)
}