##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
4 2 1 2 10 3 1 20 1 3 15 2 3 25
1 2 3
5 3 1 1 5 2 1 10 1 2 15 3 4 20 4 3 30
1
2 2 10 20 100 30 40 200
Given a list of transaction logs, where each log contains a sender ID, a recipient ID, and a transaction amount, find all user IDs that have a number of transactions greater than or equal to a given threshold.
A transaction involves two users — the sender and the recipient. Each transaction increments the count of both the sender and the recipient. However, if the sender and recipient are the same user (a self-transaction), it only counts as one transaction for that user.
Return the qualifying user IDs sorted in ascending numeric order.
If no user meets the threshold, output an empty line.
Transaction counts: user 1 appears in 3 transactions (as sender twice, recipient once). User 2 appears in 2 transactions. User 3 appears in 3 transactions. With threshold , users 1, 2, and 3 all qualify. Output sorted: 1 2 3.
User 1: self-transaction counts as 1, plus 2 more = 3 total. User 2: appears in 2 transactions. User 3: appears in 2 transactions. User 4: appears in 2 transactions. Only user 1 meets threshold . Output: 1.
Each user appears in exactly 1 transaction. No user has count . Output is empty.