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 02:17olliecrowolliecrowScore: 3,149Success
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 02:173,13256,772,19533,434,0001,013,0002,277,376
2Mar 27, 2026 02:173,13562,405,54433,476,0001,014,0002,277,376
3Mar 27, 2026 02:173,13555,923,68933,472,0001,014,0002,277,376
4Mar 27, 2026 02:173,13759,678,08933,493,0001,014,0002,277,376
5Mar 27, 2026 02:173,14054,826,97233,522,0001,015,0002,400,256
6Mar 27, 2026 02:173,14264,777,51634,558,00002,404,352
7Mar 27, 2026 02:173,14365,079,13434,570,00002,387,968
8Mar 27, 2026 02:173,14364,694,14834,576,00002,519,040
9Mar 27, 2026 02:173,14464,010,05134,587,00002,408,448
10Mar 27, 2026 02:173,14562,078,02133,576,0001,017,0002,277,376
11Mar 27, 2026 02:173,14559,290,73034,598,00002,277,376
12Mar 27, 2026 02:173,14562,889,57533,581,0001,017,0002,396,160
13Mar 27, 2026 02:173,14662,127,45433,586,0001,017,0002,277,376
14Mar 27, 2026 02:173,14660,762,61234,603,00002,404,352
15Mar 27, 2026 02:173,14763,647,69533,604,0001,018,0002,277,376
16Mar 27, 2026 02:173,14961,225,34033,616,0001,018,0002,408,448
17Mar 27, 2026 02:173,14964,517,96534,642,00002,396,160
18Mar 27, 2026 02:173,14958,128,59534,635,00002,277,376
19Mar 27, 2026 02:173,15260,553,60634,668,00002,277,376
20Mar 27, 2026 02:173,15261,645,35434,672,00002,277,376
21Mar 27, 2026 02:173,15460,795,73433,676,0001,020,0002,392,064
22Mar 27, 2026 02:173,15561,576,97633,684,0001,020,0002,277,376
23Mar 27, 2026 02:173,16560,512,52433,819,000994,0002,400,256
24Mar 27, 2026 02:173,16757,390,48633,846,000995,0002,277,376
25Mar 27, 2026 02:173,16760,077,39133,845,000995,0002,400,256
26Mar 27, 2026 02:173,16860,980,95233,854,000995,0002,277,376
27Mar 27, 2026 02:173,16962,137,21932,869,0001,992,0002,400,256
28Mar 27, 2026 02:173,16959,863,09134,859,00002,404,352
29Mar 27, 2026 02:173,17061,768,33934,871,00002,277,376
30Mar 27, 2026 02:173,17156,798,20933,887,000996,0002,494,464