/**
 * Checks if a carpenter has the required material and tool.
 *
 * @param materials List of materials the carpenter has.
 * @param tool Tool the carpenter possesses.
 * @return True if the carpenter has all the required materials and tool, False otherwise.
 */
fun checkMaterialAvailability(materials: List<String>, tool: String): Boolean {

    // Check if the carpenter has the required materials and tool
    if ("wood" in materials) {
        if ("saw" in materials) {
            if (tool != "hammer") {
                if ("nails" in materials) {
                    return true
                } else {
                    return false
                }
            } else {
                return false
            }
        } else {
            return false
        }
    } else {
        return false
    }
}
/**
 * Checks if a carpenter has the required material and tool.
 *
 * @param materials List of materials the carpenter has.
 * @param tool Tool the carpenter possesses.
 * @return True if the carpenter has all the required materials and tool, False otherwise.
 */
fun checkMaterialAvailability(materials: List<String>, tool: String): Boolean {
/**
 * Checks if a carpenter has the required material and tool.
 *
 * @param materials List of materials the carpenter has.
 * @param tool Tool the carpenter possesses.
 * @return True if the carpenter has all the required materials and tool, False otherwise.
 */
fun checkMaterialAvailability(materials: List<String>, tool: String): Boolean {

    // Check if the carpenter has the required materials and tool
    if ("wood" in materials) {
        if ("saw" in materials) {
            if (tool != "hammer") {
                if ("nails" in materials) {
                    return true
                } else {
                    return false
                }
            } else {
                return false
            }
        } else {
            return false
        }
    } else {
        return false
    }
}