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 28, 2026 04:28olliecrowolliecrowScore: 3,326Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 28, 2026 04:393,31261,044,44735,422,0001,012,0002,506,752
2Mar 28, 2026 04:473,31459,919,47535,446,0001,012,0002,359,296
3Mar 28, 2026 04:273,31964,922,40636,509,00002,367,488
4Mar 28, 2026 04:273,31957,695,50035,490,0001,014,0002,363,392
5Mar 28, 2026 04:273,32156,901,64936,530,00002,473,984
6Mar 14, 2026 10:153,32260,340,37636,545,00002,367,488
7Mar 28, 2026 04:283,32257,422,21635,529,0001,015,0002,367,488
8Mar 28, 2026 04:273,32256,800,70535,530,0001,015,0002,355,200
9Mar 28, 2026 04:143,32359,465,35035,538,0001,015,0002,289,664
10Mar 28, 2026 04:393,32365,489,20035,535,0001,015,0002,367,488
11Mar 14, 2026 10:153,32459,581,21036,559,00002,359,296
12Mar 28, 2026 04:273,32461,530,81036,569,00002,289,664
13Mar 28, 2026 04:473,32663,184,20035,570,0001,016,0002,367,488
14Mar 28, 2026 04:273,32863,733,50535,587,0001,016,0002,289,664
15Mar 28, 2026 04:143,32963,228,22935,599,0001,017,0002,289,664
16Mar 28, 2026 04:273,34963,610,15335,845,000995,0002,375,680
17Mar 28, 2026 04:473,34964,670,65834,851,0001,991,0002,289,664
18Mar 28, 2026 04:273,35063,735,53834,857,0001,991,0002,289,664
19Mar 28, 2026 04:283,35060,866,16934,861,0001,992,0002,367,488
20Mar 28, 2026 04:143,35063,959,92634,860,0001,992,0002,289,664
21Mar 28, 2026 04:393,35162,045,33035,868,000996,0002,363,392
22Mar 14, 2026 10:153,35163,490,52735,866,000996,0002,359,296
23Mar 28, 2026 04:283,35263,011,87035,872,000996,0002,363,392
24Mar 28, 2026 04:273,35358,143,20234,894,0001,993,0002,375,680