/**
 * This function finds the common tools between two toolboxes.
 *
 * @param toolbox1 A list of strings representing the tools in the first toolbox.
 * @param toolbox2 A list of strings representing the tools in the second toolbox.
 * @return A list of strings representing the common tools found in the two toolboxes.
 */
fun findCommonTools(toolbox1: List<String>, toolbox2: List<String>): List<String> {

    val commonTools = mutableListOf<String>()
    
    // Iterate over each tool in toolbox1
    for (tool1 in toolbox1) {
        // Iterate over each tool in toolbox2
        for (tool2 in toolbox2) {
            // Check if tool1 and tool2 are the same
            if (tool1 == tool2) {
                // Add the tool to the list of common tools
                commonTools.add(tool1)
            }
        }
    }
    
    return commonTools
}

// Carpenter's toolboxes
val toolbox1 = listOf("hammer", "saw", "screwdriver", "chisel", "pliers")
val toolbox2 = listOf("screwdriver", "chisel", "wrench", "sandpaper", "level")

// Find the common tools between the two toolboxes
val commonTools = findCommonTools(toolbox1, toolbox2)
/**
 * This function finds the common tools between two toolboxes.
 *
 * @param toolbox1 A list of strings representing the tools in the first toolbox.
 * @param toolbox2 A list of strings representing the tools in the second toolbox.
 * @return A list of strings representing the common tools found in the two toolboxes.
 */
fun findCommonTools(toolbox1: List<String>, toolbox2: List<String>): List<String> {
/**
 * This function finds the common tools between two toolboxes.
 *
 * @param toolbox1 A list of strings representing the tools in the first toolbox.
 * @param toolbox2 A list of strings representing the tools in the second toolbox.
 * @return A list of strings representing the common tools found in the two toolboxes.
 */
fun findCommonTools(toolbox1: List<String>, toolbox2: List<String>): List<String> {

    val commonTools = mutableListOf<String>()
    
    // Iterate over each tool in toolbox1
    for (tool1 in toolbox1) {
        // Iterate over each tool in toolbox2
        for (tool2 in toolbox2) {
            // Check if tool1 and tool2 are the same
            if (tool1 == tool2) {
                // Add the tool to the list of common tools
                commonTools.add(tool1)
            }
        }
    }
    
    return commonTools
}

// Carpenter's toolboxes
val toolbox1 = listOf("hammer", "saw", "screwdriver", "chisel", "pliers")
val toolbox2 = listOf("screwdriver", "chisel", "wrench", "sandpaper", "level")

// Find the common tools between the two toolboxes
val commonTools = findCommonTools(toolbox1, toolbox2)