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 listMar 25, 2026 20:27Dominique GarmierDominique GarmierScore: 20,049Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 25, 2026 21:0820,019243,926,668219,210,0001,000,0002,334,720
2Mar 25, 2026 21:0820,019246,256,663219,211,0001,000,0002,457,600
3Mar 25, 2026 18:4820,026243,320,281218,287,0002,002,0002,461,696
4Mar 26, 2026 10:3220,028244,603,369218,306,0002,002,0002,334,720
5Mar 25, 2026 18:4820,039247,605,922219,428,0001,001,0002,334,720
6Mar 25, 2026 18:4820,041244,857,395219,454,0001,002,0002,457,600
7Mar 26, 2026 10:3220,049253,861,758219,539,0001,002,0002,334,720
8Mar 26, 2026 10:3220,052250,422,322219,573,0001,002,0002,334,720
9Mar 25, 2026 20:2720,054244,029,097219,590,0001,002,0002,334,720
10Mar 25, 2026 21:0820,063248,238,907218,691,0001,997,0002,465,792
11Mar 25, 2026 20:2720,082243,988,670218,905,0001,999,0002,334,720
12Mar 25, 2026 20:2720,085245,157,327218,934,0001,999,0002,334,720