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 19, 2026 23:29Dominique GarmierDominique GarmierScore: 7,461Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 19, 2026 23:067,439106,562,88779,837,0001,995,0002,510,848
2Mar 19, 2026 23:167,442108,999,58779,871,0001,996,0002,502,656
3Mar 19, 2026 23:167,442111,665,36279,863,0001,996,0002,498,560
4Mar 19, 2026 23:017,444120,516,76478,893,0002,995,0002,326,528
5Mar 19, 2026 23:117,444107,874,06079,883,0001,997,0002,330,624
6Mar 19, 2026 23:017,453109,046,01779,989,0001,999,0002,506,752
7Mar 19, 2026 23:167,453114,333,64279,985,0001,999,0002,490,368
8Mar 19, 2026 23:167,454107,460,19579,997,0001,999,0002,494,464
9Mar 19, 2026 23:017,455110,474,41781,009,0001,000,0002,330,624
10Mar 19, 2026 23:297,455108,369,91780,009,0002,000,0002,326,528
11Mar 19, 2026 23:067,455113,010,54781,008,0001,000,0002,330,624
12Mar 19, 2026 23:117,461108,238,64380,066,0002,001,0002,494,464
13Mar 19, 2026 23:017,461103,681,39980,071,0002,001,0002,326,528
14Mar 19, 2026 23:017,461111,272,63380,070,0002,001,0002,502,656
15Mar 19, 2026 23:017,463103,521,36082,094,00002,326,528
16Mar 19, 2026 23:167,463112,210,82780,096,0002,002,0002,494,464
17Mar 19, 2026 23:297,465110,724,68881,111,0001,001,0002,502,656
18Mar 19, 2026 23:067,469112,421,37680,155,0002,003,0002,326,528
19Mar 19, 2026 23:017,477109,924,29880,237,0002,005,0002,498,560
20Mar 19, 2026 23:017,478107,221,59580,254,0002,006,0002,502,656
21Mar 19, 2026 23:167,478105,520,62980,255,0002,006,0002,330,624
22Mar 19, 2026 23:017,482109,238,90081,304,0001,003,0002,506,752
23Mar 19, 2026 23:117,482104,656,70281,303,0001,003,0002,498,560
24Mar 19, 2026 23:167,486112,282,61881,346,0001,004,0002,330,624
25Mar 19, 2026 23:297,494110,466,37881,428,0001,005,0002,330,624
26Mar 19, 2026 23:167,498115,489,53082,474,00002,506,752
27Mar 19, 2026 23:167,502103,678,28681,520,0001,006,0002,494,464