/**
 * Given a list of strings and a separator, this function returns a single string that joins all the strings
 * in the list together using the provided separator.
 *
 * @param stringList List of strings.
 * @param separator Separator to be used to join the strings together.
 * @return A single string formed by joining all the strings in the list using the separator.
 */
fun joinStrings(stringList: List<String>, separator: String): String {

    if (stringList.isEmpty()) {
        return ""
    }

    var output = ""

    for ((index, str) in stringList.withIndex()) {
        output += if (index < stringList.size - 1) {
            "$str$separator"
        } else {
            str
        }
    }

    return output
}
/**
 * Given a list of strings and a separator, this function returns a single string that joins all the strings
 * in the list together using the provided separator.
 *
 * @param stringList List of strings.
 * @param separator Separator to be used to join the strings together.
 * @return A single string formed by joining all the strings in the list using the separator.
 */
fun joinStrings(stringList: List<String>, separator: String): String {
/**
 * Given a list of strings and a separator, this function returns a single string that joins all the strings
 * in the list together using the provided separator.
 *
 * @param stringList List of strings.
 * @param separator Separator to be used to join the strings together.
 * @return A single string formed by joining all the strings in the list using the separator.
 */
fun joinStrings(stringList: List<String>, separator: String): String {

    if (stringList.isEmpty()) {
        return ""
    }

    var output = ""

    for ((index, str) in stringList.withIndex()) {
        output += if (index < stringList.size - 1) {
            "$str$separator"
        } else {
            str
        }
    }

    return output
}