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 04:55olliecrowolliecrowScore: 3,152Success
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 04:553,13756,721,49234,511,00002,277,376
2Mar 27, 2026 04:553,14363,598,79833,556,0001,016,0002,277,376
3Mar 27, 2026 04:553,14563,144,38433,574,0001,017,0002,404,352
4Mar 27, 2026 04:553,14560,779,74633,574,0001,017,0002,392,064
5Mar 27, 2026 04:553,14862,055,42334,631,00002,277,376
6Mar 27, 2026 04:553,14857,461,48534,624,00002,277,376
7Mar 27, 2026 04:553,14968,056,36633,623,0001,018,0002,277,376
8Mar 27, 2026 04:553,14959,095,93633,625,0001,018,0002,392,064
9Mar 27, 2026 04:553,15066,406,46833,632,0001,019,0002,277,376
10Mar 27, 2026 04:553,15067,545,28233,627,0001,019,0002,387,968
11Mar 27, 2026 04:553,15064,944,02233,628,0001,019,0002,277,376
12Mar 27, 2026 04:553,15164,241,92334,666,00002,277,376
13Mar 27, 2026 04:553,15260,539,53533,656,0001,019,0002,277,376
14Mar 27, 2026 04:553,15360,059,06933,662,0001,020,0002,277,376
15Mar 27, 2026 04:553,15358,970,55934,681,00002,400,256
16Mar 27, 2026 04:553,15565,908,14434,702,00002,400,256
17Mar 27, 2026 04:553,16766,780,81933,843,000995,0002,277,376
18Mar 27, 2026 04:553,16760,436,53134,835,00002,277,376
19Mar 27, 2026 04:553,16863,039,45633,848,000995,0002,277,376
20Mar 27, 2026 04:553,16960,866,21732,864,0001,991,0002,400,256
21Mar 27, 2026 04:553,16963,691,35432,869,0001,992,0002,392,064
22Mar 27, 2026 04:553,17165,058,96234,877,00002,277,376
23Mar 27, 2026 04:553,17356,780,03332,906,0001,994,0002,277,376
24Mar 27, 2026 04:553,17653,537,93333,934,000998,0002,396,160