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 29, 2026 19:04olliecrowolliecrowScore: 3,169Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 29, 2026 19:083,14957,252,30833,625,0001,018,0002,396,160
2Mar 29, 2026 19:033,15162,891,62034,663,00002,404,352
3Mar 29, 2026 19:023,15159,679,59433,645,0001,019,0002,277,376
4Mar 29, 2026 19:063,15261,074,74833,656,0001,019,0002,404,352
5Mar 29, 2026 19:073,15360,026,65934,688,00002,277,376
6Mar 29, 2026 19:033,15359,137,18533,663,0001,020,0002,392,064
7Mar 29, 2026 19:053,15466,052,45233,679,0001,020,0002,396,160
8Mar 29, 2026 19:083,15561,038,81234,705,00002,404,352
9Mar 29, 2026 19:043,15660,463,48433,700,0001,021,0002,396,160
10Mar 29, 2026 19:023,16562,766,51533,819,000994,0002,400,256
11Mar 29, 2026 19:013,16560,027,89534,812,00002,400,256
12Mar 29, 2026 19:103,16765,985,45633,846,000995,0002,277,376
13Mar 29, 2026 19:103,16855,093,76434,850,00002,277,376
14Mar 29, 2026 19:073,16868,127,84632,862,0001,991,0002,408,448
15Mar 29, 2026 19:073,16860,011,52532,861,0001,991,0002,486,272
16Mar 29, 2026 19:103,16860,173,91034,851,00002,519,040
17Mar 29, 2026 19:063,16861,454,32233,849,000995,0002,400,256
18Mar 29, 2026 19:013,16861,480,46833,851,000995,0002,277,376
19Mar 29, 2026 19:023,16864,874,17733,855,000995,0002,396,160
20Mar 29, 2026 19:013,16959,005,69933,868,000996,0002,408,448
21Mar 29, 2026 19:013,16966,822,29433,862,000995,0002,408,448
22Mar 29, 2026 19:043,16965,872,91332,872,0001,992,0002,392,064
23Mar 29, 2026 19:043,16962,987,33733,867,000996,0002,510,848
24Mar 29, 2026 19:073,16964,561,49633,860,000995,0002,277,376
25Mar 29, 2026 19:093,16960,478,85033,862,000995,0002,277,376
26Mar 29, 2026 19:083,16957,403,33533,861,000995,0002,277,376
27Mar 29, 2026 19:013,17065,219,24532,876,0001,992,0002,277,376
28Mar 29, 2026 19:093,17063,864,89832,874,0001,992,0002,400,256
29Mar 29, 2026 19:083,17356,772,06832,913,0001,994,0002,404,352
30Mar 29, 2026 19:093,17459,346,22632,922,0001,995,0002,277,376
31Mar 29, 2026 19:103,17559,230,48033,927,000997,0002,277,376
32Mar 29, 2026 19:073,17557,137,66032,934,0001,996,0002,392,064
33Mar 29, 2026 19:053,17661,600,80532,945,0001,996,0002,396,160
34Mar 29, 2026 19:083,17957,125,59732,975,0001,998,0002,400,256
35Mar 29, 2026 19:073,17965,108,51732,970,0001,998,0002,396,160
36Mar 29, 2026 19:083,18059,573,99233,983,000999,0002,277,376
37Mar 29, 2026 19:103,18059,978,79633,983,000999,0002,277,376
38Mar 29, 2026 19:043,18159,020,77533,993,000999,0002,400,256
39Mar 29, 2026 19:063,18259,577,56634,004,0001,000,0002,281,472
40Mar 29, 2026 19:053,18257,296,09533,005,0002,000,0002,400,256
41Mar 29, 2026 19:043,18558,466,27133,029,0002,001,0002,404,352
42Mar 29, 2026 19:043,18562,609,01433,030,0002,001,0002,277,376
43Mar 29, 2026 19:013,18660,131,39033,039,0002,002,0002,400,256
44Mar 29, 2026 19:103,18661,509,57733,045,0002,002,0002,277,376
45Mar 29, 2026 19:033,18958,338,87233,070,0002,004,0002,277,376