/**
 * Given a paragraph and a list of words, replace each occurrence of a word in the paragraph with the word itself surrounded by 
 * square brackets.
 *
 * @param paragraph The input paragraph.
 * @param wordList A list of words to be replaced.
 * @return The modified paragraph with the words surrounded by square brackets.
 */
fun replaceWords(paragraph: String, wordList: List<String>): String {

    var modifiedParagraph = paragraph
    for (word in wordList) {
        modifiedParagraph = modifiedParagraph.replace(word, "[$word]")
    }
    return modifiedParagraph
}
/**
 * Given a paragraph and a list of words, replace each occurrence of a word in the paragraph with the word itself surrounded by 
 * square brackets.
 *
 * @param paragraph The input paragraph.
 * @param wordList A list of words to be replaced.
 * @return The modified paragraph with the words surrounded by square brackets.
 */
fun replaceWords(paragraph: String, wordList: List<String>): String {
/**
 * Given a paragraph and a list of words, replace each occurrence of a word in the paragraph with the word itself surrounded by 
 * square brackets.
 *
 * @param paragraph The input paragraph.
 * @param wordList A list of words to be replaced.
 * @return The modified paragraph with the words surrounded by square brackets.
 */
fun replaceWords(paragraph: String, wordList: List<String>): String {

    var modifiedParagraph = paragraph
    for (word in wordList) {
        modifiedParagraph = modifiedParagraph.replace(word, "[$word]")
    }
    return modifiedParagraph
}