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 listNov 2, 2026 18:23Andrew EpsteinAndrew EpsteinScore: 270,599Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 2, 2026 18:25270,3072,986,903,1522,961,341,00012,039,0002,125,824stderr
2Nov 2, 2026 18:25270,4402,988,003,1922,962,800,00012,040,0002,125,824stderr
3Nov 2, 2026 18:25270,4772,988,693,3202,963,145,00012,103,0002,125,824stderr
4Nov 2, 2026 18:25270,5492,989,301,3642,965,017,00011,029,0002,125,824stderr
5Nov 2, 2026 18:25270,5992,989,374,1542,965,554,00011,035,0002,125,824stderr
6Nov 2, 2026 18:25270,9242,993,734,2142,968,135,00012,035,0002,125,824stderr
7Nov 2, 2026 18:25270,9652,994,490,3722,969,585,00011,033,0002,125,824stderr
8Nov 2, 2026 18:25271,1122,995,311,2202,970,098,00012,137,0002,125,824stderr
9Nov 2, 2026 18:25271,2563,000,640,1952,971,685,00012,138,0002,125,824stderr