/**
 * Given a list of tools, extract the name and type of each tool using enumerate(),
 * and return a list of tools common to carpenters.
 *
 * @param tools List of tools to be processed.
 * @return List of common tools for carpenters.
 */
fun enumerateCommonTools(tools: List<String>): List<Pair<String, String>> {

    // Create a list of common tools for carpenters
    val carpenterTools = listOf("hammer", "saw", "chisel", "screwdriver", "measuring tape")

    // Initialize an empty list to store common tools
    val commonTools = mutableListOf<Pair<String, String>>()

    // Enumerate through the list of tools
    for ((index, tool) in tools.withIndex()) {
        // Check if the tool is common to carpenters
        if (tool in carpenterTools) {
            // Append the tool name and type to the common tools list
            commonTools.add(Pair(tool, "carpentry"))
        }
    }

    return commonTools
}
/**
 * Given a list of tools, extract the name and type of each tool using enumerate(),
 * and return a list of tools common to carpenters.
 *
 * @param tools List of tools to be processed.
 * @return List of common tools for carpenters.
 */
fun enumerateCommonTools(tools: List<String>): List<Pair<String, String>> {
/**
 * Given a list of tools, extract the name and type of each tool using enumerate(),
 * and return a list of tools common to carpenters.
 *
 * @param tools List of tools to be processed.
 * @return List of common tools for carpenters.
 */
fun enumerateCommonTools(tools: List<String>): List<Pair<String, String>> {

    // Create a list of common tools for carpenters
    val carpenterTools = listOf("hammer", "saw", "chisel", "screwdriver", "measuring tape")

    // Initialize an empty list to store common tools
    val commonTools = mutableListOf<Pair<String, String>>()

    // Enumerate through the list of tools
    for ((index, tool) in tools.withIndex()) {
        // Check if the tool is common to carpenters
        if (tool in carpenterTools) {
            // Append the tool name and type to the common tools list
            commonTools.add(Pair(tool, "carpentry"))
        }
    }

    return commonTools
}