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 listApr 24, 2026 20:06olliecrowolliecrowScore: 7,991Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 24, 2026 20:077,972103,314,03985,680,0002,016,0002,490,368
2Apr 24, 2026 20:077,984103,305,49484,833,0002,994,0002,486,272
3Apr 24, 2026 20:077,985101,419,59185,846,0001,996,0002,502,656
4Apr 24, 2026 20:077,991101,933,08585,890,0002,020,0002,375,680
5Apr 24, 2026 20:077,991101,276,44785,907,0001,997,0002,478,080
6Apr 24, 2026 20:077,997108,406,35085,972,0001,999,0002,478,080
7Apr 24, 2026 20:077,999104,660,44682,991,0004,999,0002,494,464
8Apr 24, 2026 20:078,003102,692,08686,041,0002,000,0002,494,464
9Apr 24, 2026 20:078,018103,550,88686,203,0002,004,0002,543,616