/**
 * This exercise requires you to concatenate the names of carpenter tools and separate them using the provided separator.
 *
 * @param tools a list of strings representing carpenter tools' names
 * @param separator a string representing the separator to use between tool names
 * @return a string containing all the carpenter tools' names concatenated with the provided separator
 *
 * Example:
 * concatenateCarpenterTools(listOf("saw", "hammer", "chisel"), " | ") should return "saw | hammer | chisel"
 */
fun concatenateCarpenterTools(tools: List<String>, separator: String): String {

    // Check if tools list is empty
    if (tools.isEmpty()) {
        return ""
    }

    // Initialize the concatenatedTools variable with the first tool
    var concatenatedTools = tools[0]

    // Iterate over the remaining tools, starting from the second one
    for (i in 1 until tools.size) {
        val tool = tools[i]
        // Check if the tool is not an empty string
        if (tool.isNotEmpty()) {
            // Concatenate the tool name with the separator and append it to the concatenatedTools variable
            concatenatedTools += "$separator$tool"
        }
    }

    return concatenatedTools
}
/**
 * This exercise requires you to concatenate the names of carpenter tools and separate them using the provided separator.
 *
 * @param tools a list of strings representing carpenter tools' names
 * @param separator a string representing the separator to use between tool names
 * @return a string containing all the carpenter tools' names concatenated with the provided separator
 *
 * Example:
 * concatenateCarpenterTools(listOf("saw", "hammer", "chisel"), " | ") should return "saw | hammer | chisel"
 */
fun concatenateCarpenterTools(tools: List<String>, separator: String): String {
/**
 * This exercise requires you to concatenate the names of carpenter tools and separate them using the provided separator.
 *
 * @param tools a list of strings representing carpenter tools' names
 * @param separator a string representing the separator to use between tool names
 * @return a string containing all the carpenter tools' names concatenated with the provided separator
 *
 * Example:
 * concatenateCarpenterTools(listOf("saw", "hammer", "chisel"), " | ") should return "saw | hammer | chisel"
 */
fun concatenateCarpenterTools(tools: List<String>, separator: String): String {

    // Check if tools list is empty
    if (tools.isEmpty()) {
        return ""
    }

    // Initialize the concatenatedTools variable with the first tool
    var concatenatedTools = tools[0]

    // Iterate over the remaining tools, starting from the second one
    for (i in 1 until tools.size) {
        val tool = tools[i]
        // Check if the tool is not an empty string
        if (tool.isNotEmpty()) {
            // Concatenate the tool name with the separator and append it to the concatenatedTools variable
            concatenatedTools += "$separator$tool"
        }
    }

    return concatenatedTools
}