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 listOct 16, 2026 22:41izotoffizotoffScore: 481,336Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 16, 2026 22:45479,7475,289,490,6885,177,165,000100,053,0002,138,112
2Oct 16, 2026 22:45480,4345,299,345,3255,183,728,000101,053,0002,138,112
3Oct 16, 2026 22:45480,9535,302,867,1325,190,362,000100,127,0002,138,112
4Oct 16, 2026 22:45481,2355,306,006,4225,191,541,000102,046,0002,142,208
5Oct 16, 2026 22:45481,3365,307,111,8005,193,435,000101,268,0002,138,112
6Oct 16, 2026 22:45481,6555,310,312,5305,196,160,000102,049,0002,142,208
7Oct 16, 2026 22:45481,8175,312,450,1965,197,941,000102,050,0002,138,112
8Oct 16, 2026 22:45481,8375,323,940,1945,196,911,000103,304,0002,142,208
9Oct 16, 2026 22:45484,4395,341,634,0085,225,638,000103,194,0002,142,208