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 22:58Dominique GarmierDominique GarmierScore: 7,491Success
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 22:557,460108,038,44080,061,0002,001,0002,330,624
2Mar 19, 2026 22:537,473110,708,16681,196,0001,002,0002,502,656
3Mar 19, 2026 22:537,476117,494,95880,236,0002,005,0002,498,560
4Mar 19, 2026 22:537,479110,115,79681,263,0001,003,0002,498,560
5Mar 19, 2026 22:537,481112,088,92980,289,0002,007,0002,330,624
6Mar 19, 2026 22:537,484114,326,23281,325,0001,004,0002,498,560
7Mar 19, 2026 22:557,485107,223,67680,329,0002,008,0002,506,752
8Mar 19, 2026 22:537,489112,804,50981,373,0001,004,0002,502,656
9Mar 19, 2026 22:587,489112,237,37880,373,0002,009,0002,330,624
10Mar 25, 2026 01:057,491113,953,99782,404,00002,326,528
11Mar 19, 2026 22:557,495110,117,61881,443,0001,005,0002,330,624
12Mar 19, 2026 22:537,500113,830,07181,492,0001,006,0002,506,752
13Mar 25, 2026 01:057,503110,716,02282,538,00002,514,944
14Mar 19, 2026 22:537,508110,637,41481,576,0001,007,0002,322,432
15Mar 25, 2026 01:057,509111,100,80481,594,0001,007,0002,502,656
16Mar 19, 2026 22:537,528105,803,94980,809,0001,995,0002,498,560
17Mar 19, 2026 22:587,530111,115,10782,835,00002,330,624
18Mar 19, 2026 22:587,531113,736,51680,845,0001,996,0002,326,528