/**
 * The function finds common collisions between bill portfolio and settlement transactions.
 *
 * @param billPortfolio A dictionary containing bill numbers as keys and their respective information as values.
 * @param settlementTransactions A dictionary containing settlement IDs as keys and their corresponding details as values.
 * @return A list of bill numbers that have a collision with settlement IDs.
 */
fun findCollision(billPortfolio: Map<String, Map<String, Any>>, settlementTransactions: Map<String, Map<String, Any>>): List<String> {

    // Initialize an empty list to store the collision bill numbers
    val collisionBills = mutableListOf<String>()

    // Iterate over each bill in the bill portfolio
    for ((billNumber, billInfo) in billPortfolio) {
        // Iterate over each settlement in the settlement transactions
        for ((settlementId, settlementInfo) in settlementTransactions) {
            // Check if the bill number and settlement ID match
            if (billNumber == settlementInfo["bill_number"]) {
                // Check if the settlement amount is greater than the bill amount
                if (settlementInfo["amount"] as Int > billInfo["amount"] as Int) {
                    // Append the bill number to the collisionBills list
                    collisionBills.add(billNumber)
                }
            }
        }
    }

    // Return the list of collision bill numbers
    return collisionBills
}
/**
 * The function finds common collisions between bill portfolio and settlement transactions.
 *
 * @param billPortfolio A dictionary containing bill numbers as keys and their respective information as values.
 * @param settlementTransactions A dictionary containing settlement IDs as keys and their corresponding details as values.
 * @return A list of bill numbers that have a collision with settlement IDs.
 */
fun findCollision(billPortfolio: Map<String, Map<String, Any>>, settlementTransactions: Map<String, Map<String, Any>>): List<String> {
/**
 * The function finds common collisions between bill portfolio and settlement transactions.
 *
 * @param billPortfolio A dictionary containing bill numbers as keys and their respective information as values.
 * @param settlementTransactions A dictionary containing settlement IDs as keys and their corresponding details as values.
 * @return A list of bill numbers that have a collision with settlement IDs.
 */
fun findCollision(billPortfolio: Map<String, Map<String, Any>>, settlementTransactions: Map<String, Map<String, Any>>): List<String> {

    // Initialize an empty list to store the collision bill numbers
    val collisionBills = mutableListOf<String>()

    // Iterate over each bill in the bill portfolio
    for ((billNumber, billInfo) in billPortfolio) {
        // Iterate over each settlement in the settlement transactions
        for ((settlementId, settlementInfo) in settlementTransactions) {
            // Check if the bill number and settlement ID match
            if (billNumber == settlementInfo["bill_number"]) {
                // Check if the settlement amount is greater than the bill amount
                if (settlementInfo["amount"] as Int > billInfo["amount"] as Int) {
                    // Append the bill number to the collisionBills list
                    collisionBills.add(billNumber)
                }
            }
        }
    }

    // Return the list of collision bill numbers
    return collisionBills
}