/**
 * This function takes a list of transactions and filters out all the expenses using the OR operator.
 * It then returns the list of expenses.
 *
 * @param transactions A list of dictionaries representing different transactions.
 * @return A list of dictionaries representing expenses.
 *
 * Example:
 * transactions = listOf(
 *     mapOf("type" to "expense", "amount" to 50),
 *     mapOf("type" to "income", "amount" to 100),
 *     mapOf("type" to "expense", "amount" to 75),
 *     mapOf("type" to "expense", "amount" to 25),
 *     mapOf("type" to "income", "amount" to 200)
 * )
 * createExpenseList(transactions) will return:
 * listOf(
 *     mapOf("type" to "expense", "amount" to 50),
 *     mapOf("type" to "expense", "amount" to 75),
 *     mapOf("type" to "expense", "amount" to 25)
 * )
 */
fun createExpenseList(transactions: List<Map<String, Any>>): List<Map<String, Any>> {

    val expenses = mutableListOf<Map<String, Any>>()

    for (transaction in transactions) {
        if (transaction["type"] == "expense" || transaction["type"] == "time_cost") {
            expenses.add(transaction)
        }
    }

    return expenses
}
/**
 * This function takes a list of transactions and filters out all the expenses using the OR operator.
 * It then returns the list of expenses.
 *
 * @param transactions A list of dictionaries representing different transactions.
 * @return A list of dictionaries representing expenses.
 *
 * Example:
 * transactions = listOf(
 *     mapOf("type" to "expense", "amount" to 50),
 *     mapOf("type" to "income", "amount" to 100),
 *     mapOf("type" to "expense", "amount" to 75),
 *     mapOf("type" to "expense", "amount" to 25),
 *     mapOf("type" to "income", "amount" to 200)
 * )
 * createExpenseList(transactions) will return:
 * listOf(
 *     mapOf("type" to "expense", "amount" to 50),
 *     mapOf("type" to "expense", "amount" to 75),
 *     mapOf("type" to "expense", "amount" to 25)
 * )
 */
fun createExpenseList(transactions: List<Map<String, Any>>): List<Map<String, Any>> {
/**
 * This function takes a list of transactions and filters out all the expenses using the OR operator.
 * It then returns the list of expenses.
 *
 * @param transactions A list of dictionaries representing different transactions.
 * @return A list of dictionaries representing expenses.
 *
 * Example:
 * transactions = listOf(
 *     mapOf("type" to "expense", "amount" to 50),
 *     mapOf("type" to "income", "amount" to 100),
 *     mapOf("type" to "expense", "amount" to 75),
 *     mapOf("type" to "expense", "amount" to 25),
 *     mapOf("type" to "income", "amount" to 200)
 * )
 * createExpenseList(transactions) will return:
 * listOf(
 *     mapOf("type" to "expense", "amount" to 50),
 *     mapOf("type" to "expense", "amount" to 75),
 *     mapOf("type" to "expense", "amount" to 25)
 * )
 */
fun createExpenseList(transactions: List<Map<String, Any>>): List<Map<String, Any>> {

    val expenses = mutableListOf<Map<String, Any>>()

    for (transaction in transactions) {
        if (transaction["type"] == "expense" || transaction["type"] == "time_cost") {
            expenses.add(transaction)
        }
    }

    return expenses
}