/**
 * This function takes a list of lawyer case numbers along with their respective fees
 * and returns a list of case numbers where the fees are below or equal to the given maximum fee.
 */
fun findLawyerCaseNumbers(caseList: List<String>, maximumFees: Int): List<String> {

    // Initialize an empty list to store the case numbers
    val selectedCases = mutableListOf<String>()

    // Iterate over each case number in the case list
    for (case in caseList) {
        // Split the case number and fee using a colon (:)
        val (caseNumber, fee) = case.split(":")

        // Convert the fee to an integer
        val feeInt = fee.toInt()

        // Check if the fee is below or equal to the maximum fee
        if (feeInt <= maximumFees) {
            // Add the case number to the list of selected cases
            selectedCases.add(caseNumber)
        }
    }

    // Return the list of selected case numbers
    return selectedCases
}

// Sample usage of the function
val caseList = listOf("CASE001:5000", "CASE002:10000", "CASE003:2000", "CASE004:15000", "CASE005:3000")
val maximumFee = 5000

val selectedCases = findLawyerCaseNumbers(caseList, maximumFee)
/**
 * This function takes a list of lawyer case numbers along with their respective fees
 * and returns a list of case numbers where the fees are below or equal to the given maximum fee.
 */
fun findLawyerCaseNumbers(caseList: List<String>, maximumFees: Int): List<String> {
/**
 * This function takes a list of lawyer case numbers along with their respective fees
 * and returns a list of case numbers where the fees are below or equal to the given maximum fee.
 */
fun findLawyerCaseNumbers(caseList: List<String>, maximumFees: Int): List<String> {

    // Initialize an empty list to store the case numbers
    val selectedCases = mutableListOf<String>()

    // Iterate over each case number in the case list
    for (case in caseList) {
        // Split the case number and fee using a colon (:)
        val (caseNumber, fee) = case.split(":")

        // Convert the fee to an integer
        val feeInt = fee.toInt()

        // Check if the fee is below or equal to the maximum fee
        if (feeInt <= maximumFees) {
            // Add the case number to the list of selected cases
            selectedCases.add(caseNumber)
        }
    }

    // Return the list of selected case numbers
    return selectedCases
}

// Sample usage of the function
val caseList = listOf("CASE001:5000", "CASE002:10000", "CASE003:2000", "CASE004:15000", "CASE005:3000")
val maximumFee = 5000

val selectedCases = findLawyerCaseNumbers(caseList, maximumFee)