/**
 * This function takes a list of strings and a separator and returns the concatenated string
 * formed by joining all the strings in the list using the separator. The concatenation is
 * performed using a while loop.
 *
 * @param strings A list of strings to concatenate.
 * @param separator The separator used to join the strings.
 * @return The concatenated string.
 */
fun combineStrings(strings: List<String>, separator: String): String {

    var concatenatedString = ""  // Initialize an empty string

    // Use a while loop to iterate through the list of strings
    var i = 0
    while (i < strings.size) {
        concatenatedString += strings[i]  // Concatenate the string at current index

        // If it's not the last element, append the separator to the concatenated string
        if (i != strings.size - 1) {
            concatenatedString += separator
        }

        i++  // Increment the index
    }

    return concatenatedString
}
/**
 * This function takes a list of strings and a separator and returns the concatenated string
 * formed by joining all the strings in the list using the separator. The concatenation is
 * performed using a while loop.
 *
 * @param strings A list of strings to concatenate.
 * @param separator The separator used to join the strings.
 * @return The concatenated string.
 */
fun combineStrings(strings: List<String>, separator: String): String {
/**
 * This function takes a list of strings and a separator and returns the concatenated string
 * formed by joining all the strings in the list using the separator. The concatenation is
 * performed using a while loop.
 *
 * @param strings A list of strings to concatenate.
 * @param separator The separator used to join the strings.
 * @return The concatenated string.
 */
fun combineStrings(strings: List<String>, separator: String): String {

    var concatenatedString = ""  // Initialize an empty string

    // Use a while loop to iterate through the list of strings
    var i = 0
    while (i < strings.size) {
        concatenatedString += strings[i]  // Concatenate the string at current index

        // If it's not the last element, append the separator to the concatenated string
        if (i != strings.size - 1) {
            concatenatedString += separator
        }

        i++  // Increment the index
    }

    return concatenatedString
}