/**
 * This exercise aims to test the understanding of the range function and string concatenation.
 * Given a start and end value for a range, as well as a substring, the task is to concatenate all the numbers
 * within the range with the substring.
 * The resulting string should include the substring between each consecutive pair of numbers in the range.
 *
 * @param rangeStart The starting value of the range (inclusive).
 * @param rangeEnd The ending value of the range (inclusive).
 * @param substring The substring to be concatenated with the numbers in the range.
 * @return The final string obtained by concatenating the numbers with the substring.
 *
 * Example:
 * concatenateStringsFromRange(1, 5, "@") should return "1@2@3@4@5"
 * concatenateStringsFromRange(10, 15, "XXX") should return "10XXX11XXX12XXX13XXX14XXX15"
 */
fun concatenateStringsFromRange(rangeStart: Int, rangeEnd: Int, substring: String): String {

    var concatenatedString = ""
    for (num in rangeStart..rangeEnd) {
        concatenatedString += "$num$substring"
    }
    return concatenatedString
}
/**
 * This exercise aims to test the understanding of the range function and string concatenation.
 * Given a start and end value for a range, as well as a substring, the task is to concatenate all the numbers
 * within the range with the substring.
 * The resulting string should include the substring between each consecutive pair of numbers in the range.
 *
 * @param rangeStart The starting value of the range (inclusive).
 * @param rangeEnd The ending value of the range (inclusive).
 * @param substring The substring to be concatenated with the numbers in the range.
 * @return The final string obtained by concatenating the numbers with the substring.
 *
 * Example:
 * concatenateStringsFromRange(1, 5, "@") should return "1@2@3@4@5"
 * concatenateStringsFromRange(10, 15, "XXX") should return "10XXX11XXX12XXX13XXX14XXX15"
 */
fun concatenateStringsFromRange(rangeStart: Int, rangeEnd: Int, substring: String): String {
/**
 * This exercise aims to test the understanding of the range function and string concatenation.
 * Given a start and end value for a range, as well as a substring, the task is to concatenate all the numbers
 * within the range with the substring.
 * The resulting string should include the substring between each consecutive pair of numbers in the range.
 *
 * @param rangeStart The starting value of the range (inclusive).
 * @param rangeEnd The ending value of the range (inclusive).
 * @param substring The substring to be concatenated with the numbers in the range.
 * @return The final string obtained by concatenating the numbers with the substring.
 *
 * Example:
 * concatenateStringsFromRange(1, 5, "@") should return "1@2@3@4@5"
 * concatenateStringsFromRange(10, 15, "XXX") should return "10XXX11XXX12XXX13XXX14XXX15"
 */
fun concatenateStringsFromRange(rangeStart: Int, rangeEnd: Int, substring: String): String {

    var concatenatedString = ""
    for (num in rangeStart..rangeEnd) {
        concatenatedString += "$num$substring"
    }
    return concatenatedString
}