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 15, 2026 11:31Dominique GarmierDominique GarmierScore: 28,701Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 15, 2026 11:3128,397335,404,209311,371,0001,001,0002,289,664
2Mar 15, 2026 11:0228,428337,819,291311,713,000999,0002,260,992
3Mar 13, 2026 17:1128,439333,267,755310,827,0001,998,0002,289,664
4Mar 20, 2026 02:3628,455340,066,047311,001,0002,000,0002,289,664
5Mar 13, 2026 17:1128,460340,081,489311,062,0002,000,0002,289,664
6Mar 13, 2026 17:1128,464337,753,220312,101,0001,000,0002,519,040
7Mar 15, 2026 11:0228,481342,459,014312,292,0001,000,0002,273,280
8Mar 13, 2026 17:1128,502337,008,774312,516,0001,001,0002,265,088
9Mar 14, 2026 16:4528,528342,164,877312,814,000999,0002,289,664
10Mar 14, 2026 16:4528,530343,795,836311,830,0001,998,0002,289,664
11Mar 14, 2026 13:2728,537337,756,522312,910,000999,0002,289,664
12Mar 13, 2026 17:1128,597341,643,164313,573,000998,0002,277,376
13Mar 14, 2026 16:4528,597347,022,779313,566,0001,001,0002,269,184
14Mar 20, 2026 02:3628,678342,158,020314,459,0001,001,0002,519,040
15Mar 15, 2026 11:0228,678346,173,649315,457,00002,273,280
16Mar 20, 2026 02:3628,695336,915,447314,643,000998,0002,273,280
17Mar 14, 2026 16:4528,701347,946,757314,712,000999,0002,289,664
18Mar 14, 2026 16:4528,713340,466,751313,840,0001,998,0002,273,280
19Mar 13, 2026 17:1128,724350,387,522314,965,000999,0002,289,664
20Mar 14, 2026 16:4528,728342,873,685314,004,0002,000,0002,269,184
21Mar 20, 2026 02:3628,752343,709,996315,267,0001,000,0002,289,664
22Mar 20, 2026 02:3628,760336,814,648315,355,0001,001,0002,260,992
23Mar 13, 2026 17:1128,773343,125,677315,502,0001,001,0002,277,376
24Mar 13, 2026 17:1128,868338,878,843316,544,0001,001,0002,289,664
25Mar 14, 2026 13:2728,929343,249,720318,217,00002,269,184
26Mar 14, 2026 16:4528,933344,312,402318,260,00002,289,664
27Mar 14, 2026 16:4528,972348,392,542316,695,0001,998,0002,289,664
28Mar 15, 2026 11:3129,004348,440,787317,039,0002,000,0002,265,088
29Mar 14, 2026 13:2729,026347,353,382318,286,0001,000,0002,269,184
30Mar 13, 2026 17:1129,036343,872,402318,391,0001,001,0002,273,280
31Mar 14, 2026 16:4529,096343,888,080318,051,0002,000,0002,289,664
32Mar 20, 2026 02:3629,312344,866,885321,431,0001,001,0002,277,376
33Mar 15, 2026 11:3129,350350,605,181321,848,000999,0002,289,664