/**
 * This function replaces a specific word in a list with another word.
 *
 * @param carpenterList A list of words.
 * @param wordToReplace The word to be replaced.
 * @param replacementWord The word to replace.
 * @return The modified list with the replaced words.
 */
fun replaceInList(carpenterList: MutableList<String>, wordToReplace: String, replacementWord: String): List<String> {

    for (i in carpenterList.indices) {
        if (carpenterList[i] == wordToReplace) {
            carpenterList[i] = replacementWord
        }
    }
    return carpenterList
}
/**
 * This function replaces a specific word in a list with another word.
 *
 * @param carpenterList A list of words.
 * @param wordToReplace The word to be replaced.
 * @param replacementWord The word to replace.
 * @return The modified list with the replaced words.
 */
fun replaceInList(carpenterList: MutableList<String>, wordToReplace: String, replacementWord: String): List<String> {
/**
 * This function replaces a specific word in a list with another word.
 *
 * @param carpenterList A list of words.
 * @param wordToReplace The word to be replaced.
 * @param replacementWord The word to replace.
 * @return The modified list with the replaced words.
 */
fun replaceInList(carpenterList: MutableList<String>, wordToReplace: String, replacementWord: String): List<String> {

    for (i in carpenterList.indices) {
        if (carpenterList[i] == wordToReplace) {
            carpenterList[i] = replacementWord
        }
    }
    return carpenterList
}