Pattern Recognition
#7hard
Detect Fraudulent Transaction Chains
A bank processes transactions as (sender, receiver, amount). A "fraud chain" exists if money flows in a cycle: A→B→C→A. Given a list of transactions, determine if any such cycle of length ≤ K exists. You may assume amounts don't matter — only the sender-receiver relationships.