Parse JSON Sergey Svistunov

Compute the total amount of non-canceled external USD transactions from a stream of JSON records as fast as possible.

Input: 1 000 000 JSON records on STDIN, one per line. Each record has the following structure:

{
    "user_id": 0,
    "currency": "USD",
    "transactions": [
        {
            "amount": 0,
            "to_user_id": 0,
            "canceled": false
        }
    ]
}
Field Constraints
user_id Integer, max 10 000
currency One of "GBP", "USD", "RUB", "JPY", "CHF"
transactions Array, max 10 elements
amount Integer, max 1000
canceled Boolean; may be omitted when false

Field order is not guaranteed within any object.

Output: The total amount of all transactions where:

  • record.currency == "USD"
  • transaction.to_user_id != record.user_id (external)
  • transaction.canceled is false or absent
Back to listAug 18, 2026 00:52Victor MerckléVictor MerckléError
Source Code

Source code access is restricted. Log in to request access.

Challenge History
DateChallengerCostTypeStatus
Sep 8, 2026 05:34C#_user10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 8, 2026 05:36039,153,57529,460,0001,236,0002,179,072expected "2 ", got "4294971653965428 "stderr
2Sep 8, 2026 05:36039,418,52029,645,0001,242,0002,134,016expected "2 ", got "4294971653965428 "stderr
3Sep 8, 2026 05:36039,361,13129,614,0001,260,0002,134,016expected "2 ", got "4294971653965428 "stderr
4Aug 18, 2026 00:592,19834,472,11022,893,0001,291,0002,179,072stderr
5Aug 18, 2026 00:592,20132,984,49222,924,0001,293,0002,179,072stderr
6Aug 18, 2026 00:592,20234,151,76922,939,0001,291,0002,179,072stderr
7Aug 18, 2026 00:592,20532,934,35722,962,0001,297,0002,179,072stderr
8Aug 18, 2026 00:592,20732,748,30323,254,0001,033,0002,179,072stderr
9Aug 18, 2026 00:592,20732,446,06623,232,0001,046,0002,179,072stderr
10Aug 18, 2026 00:592,21733,446,15323,099,0001,294,0002,134,016stderr
11Aug 18, 2026 00:592,22032,860,59623,390,0001,033,0002,134,016stderr
12Aug 18, 2026 00:592,26045,207,26123,827,0001,035,0002,179,072stderr