/**
 * Given a list of transactions, find all the account numbers that have a negative balance.
 *
 * @param transactions List of pairs where each pair contains the account number as the first element and the transaction amount as the second element.
 * @return List of account numbers with negative balance.
 *
 * Example:
 * findNegativeBalance(listOf(Pair(1001, -100), Pair(1002, 200), Pair(1003, -50), Pair(1004, 500))) returns [1001, 1003]
 */
fun findNegativeBalance(transactions: List<Pair<Int, Int>>): List<Int> {

    val negativeBalanceAccounts = mutableListOf<Int>()
    for ((account, amount) in transactions) {
        if (amount < 0) {
            negativeBalanceAccounts.add(account)
        }
    }
    return negativeBalanceAccounts
}
/**
 * Given a list of transactions, find all the account numbers that have a negative balance.
 *
 * @param transactions List of pairs where each pair contains the account number as the first element and the transaction amount as the second element.
 * @return List of account numbers with negative balance.
 *
 * Example:
 * findNegativeBalance(listOf(Pair(1001, -100), Pair(1002, 200), Pair(1003, -50), Pair(1004, 500))) returns [1001, 1003]
 */
fun findNegativeBalance(transactions: List<Pair<Int, Int>>): List<Int> {
/**
 * Given a list of transactions, find all the account numbers that have a negative balance.
 *
 * @param transactions List of pairs where each pair contains the account number as the first element and the transaction amount as the second element.
 * @return List of account numbers with negative balance.
 *
 * Example:
 * findNegativeBalance(listOf(Pair(1001, -100), Pair(1002, 200), Pair(1003, -50), Pair(1004, 500))) returns [1001, 1003]
 */
fun findNegativeBalance(transactions: List<Pair<Int, Int>>): List<Int> {

    val negativeBalanceAccounts = mutableListOf<Int>()
    for ((account, amount) in transactions) {
        if (amount < 0) {
            negativeBalanceAccounts.add(account)
        }
    }
    return negativeBalanceAccounts
}