/**
 * The carpenter wants to modify the quantities of hammers and saws in their tools list.
 * The function takes a list of tools, the number of hammers to add, and the number of saws to remove.
 * It then modifies the list and returns the updated list of tools.
 */
fun modifyLists(carpenterTools: MutableList<String>, numHammers: Int, numSaws: Int): List<String> {

    // Adding numHammers hammers to the tools list
    carpenterTools.addAll(List(numHammers) { "hammer" })

    // Removing numSaws saws from the tools list
    repeat(numSaws) {
        carpenterTools.remove("saw")
    }

    return carpenterTools
}

// Example usage:
/**
 * The carpenter wants to modify the quantities of hammers and saws in their tools list.
 * The function takes a list of tools, the number of hammers to add, and the number of saws to remove.
 * It then modifies the list and returns the updated list of tools.
 */
fun modifyLists(carpenterTools: MutableList<String>, numHammers: Int, numSaws: Int): List<String> {
/**
 * The carpenter wants to modify the quantities of hammers and saws in their tools list.
 * The function takes a list of tools, the number of hammers to add, and the number of saws to remove.
 * It then modifies the list and returns the updated list of tools.
 */
fun modifyLists(carpenterTools: MutableList<String>, numHammers: Int, numSaws: Int): List<String> {

    // Adding numHammers hammers to the tools list
    carpenterTools.addAll(List(numHammers) { "hammer" })

    // Removing numSaws saws from the tools list
    repeat(numSaws) {
        carpenterTools.remove("saw")
    }

    return carpenterTools
}

// Example usage: