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 27, 2026 06:04olliecrowolliecrowScore: 3,150Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 27, 2026 06:043,13857,339,65234,518,00002,277,376
2Mar 27, 2026 06:043,14056,694,06533,520,0001,015,0002,277,376
3Mar 27, 2026 06:043,14061,281,26433,528,0001,016,0002,277,376
4Mar 27, 2026 06:043,14262,762,90833,549,0001,016,0002,277,376
5Mar 27, 2026 06:043,14362,375,10633,553,0001,016,0002,277,376
6Mar 27, 2026 06:043,14360,936,36633,558,0001,016,0002,277,376
7Mar 27, 2026 06:043,14558,289,22033,582,0001,017,0002,400,256
8Mar 27, 2026 06:043,14665,929,67534,604,00002,277,376
9Mar 27, 2026 06:043,14861,008,16634,631,00002,387,968
10Mar 27, 2026 06:043,14963,896,26633,620,0001,018,0002,277,376
11Mar 27, 2026 06:043,14963,701,91233,616,0001,018,0002,400,256
12Mar 27, 2026 06:043,14959,650,14034,640,00002,396,160
13Mar 27, 2026 06:043,15061,025,03033,633,0001,019,0002,277,376
14Mar 27, 2026 06:043,15065,912,28034,654,00002,396,160
15Mar 27, 2026 06:043,15059,113,32634,654,00002,277,376
16Mar 27, 2026 06:043,15161,306,44434,663,00002,400,256
17Mar 27, 2026 06:043,15168,773,23633,638,0001,019,0002,396,160
18Mar 27, 2026 06:043,15259,675,00334,677,00002,277,376
19Mar 27, 2026 06:043,15263,653,49534,673,00002,277,376
20Mar 27, 2026 06:043,15262,424,50133,658,0001,019,0002,277,376
21Mar 27, 2026 06:043,15357,523,99533,665,0001,020,0002,277,376
22Mar 27, 2026 06:043,15561,530,31733,686,0001,020,0002,392,064
23Mar 27, 2026 06:043,16657,774,35032,837,0001,990,0002,519,040
24Mar 27, 2026 06:043,16858,576,68632,856,0001,991,0002,404,352