← 返回 capitalone 的题目列表Fraud Detection Algorithm for Credit Card Transactions
类型:online_judge
capitalone
Given a set of credit card transactions, including information like credit card category and transaction amount, write an algorithm to determine if each transaction is genuine or fraudulent based on specified rules. Implement these rules and return a boolean indicating the truthfulness of each transaction.
Requirements
Input: A list of transaction data, each being a tuple containing the credit card category (string) and the transaction amount (float).
Output: A list of booleans of the same length as the input list, indicating the genuineness of each transaction.
Note: Rules can be quite complex and may vary with transaction amount and credit card category.
Provide at least 5 test cases.
Test Cases
# Test Case 1
# Input: [("Category A", 100.0), ("Category B", 200.0)]
# Output: [True, False]
# Test Case 2
# Input: [("Category A", 150.0), ("Category C", 50.0)]
# Output: [False, True]
Example
Input
[("Category A", 100.0), ("Category B", 200.0)]