/**
 * Given a dictionary of case dockets and a dictionary of case verdicts,
 * this function analyzes the cases to determine the average number of cases
 * each lawyer won.
 *
 * @param caseDocket a dictionary with lawyer names as keys and their case dockets as values
 * @param caseVerdicts a dictionary with lawyer names as keys and their case verdicts as values
 * @return a floating point number representing the average number of cases won per lawyer
 */
fun lawyerCaseAnalysis(caseDocket: Map<String, List<String>>, caseVerdicts: Map<String, String>): Double {

    var totalCases = 0
    var totalLawyers = 0

    for (lawyer in caseDocket.keys) {
        // Check if the lawyer has any cases
        if (caseDocket[lawyer]?.isNotEmpty() == true) {
            // Check if the lawyer won any cases
            if (caseVerdicts.containsKey(lawyer) && caseVerdicts[lawyer] == "Won") {
                totalCases += caseDocket[lawyer]!!.size
                totalLawyers++
            }
        }
    }

    val averageCasesWon = if (totalLawyers > 0) totalCases.toDouble() / totalLawyers else 0.0

    return averageCasesWon
}
/**
 * Given a dictionary of case dockets and a dictionary of case verdicts,
 * this function analyzes the cases to determine the average number of cases
 * each lawyer won.
 *
 * @param caseDocket a dictionary with lawyer names as keys and their case dockets as values
 * @param caseVerdicts a dictionary with lawyer names as keys and their case verdicts as values
 * @return a floating point number representing the average number of cases won per lawyer
 */
fun lawyerCaseAnalysis(caseDocket: Map<String, List<String>>, caseVerdicts: Map<String, String>): Double {
/**
 * Given a dictionary of case dockets and a dictionary of case verdicts,
 * this function analyzes the cases to determine the average number of cases
 * each lawyer won.
 *
 * @param caseDocket a dictionary with lawyer names as keys and their case dockets as values
 * @param caseVerdicts a dictionary with lawyer names as keys and their case verdicts as values
 * @return a floating point number representing the average number of cases won per lawyer
 */
fun lawyerCaseAnalysis(caseDocket: Map<String, List<String>>, caseVerdicts: Map<String, String>): Double {

    var totalCases = 0
    var totalLawyers = 0

    for (lawyer in caseDocket.keys) {
        // Check if the lawyer has any cases
        if (caseDocket[lawyer]?.isNotEmpty() == true) {
            // Check if the lawyer won any cases
            if (caseVerdicts.containsKey(lawyer) && caseVerdicts[lawyer] == "Won") {
                totalCases += caseDocket[lawyer]!!.size
                totalLawyers++
            }
        }
    }

    val averageCasesWon = if (totalLawyers > 0) totalCases.toDouble() / totalLawyers else 0.0

    return averageCasesWon
}