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 12, 2025 21:19Marco BarboneMarco BarboneScore: 565,370Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 12, 2025 21:19563,2276,221,980,4536,167,523,00027,979,0002,461,696
2Oct 12, 2025 21:19564,6436,239,136,8536,173,097,00037,975,0002,445,312
3Oct 12, 2025 21:19564,8956,248,514,3966,175,877,00037,968,0002,461,696
4Oct 12, 2025 21:19565,2856,243,540,2356,188,156,00029,976,0002,461,696
5Oct 12, 2025 21:19565,3706,245,809,9606,188,093,00030,980,0002,461,696
6Oct 12, 2025 21:19566,8526,269,234,4706,190,407,00044,966,0002,461,696
7Oct 12, 2025 21:19570,2676,303,033,5616,233,974,00038,968,0002,457,600
8Oct 12, 2025 21:19570,6866,310,799,9356,245,568,00031,977,0002,461,696
9Oct 12, 2025 21:19578,2336,386,461,9066,317,598,00042,970,0002,461,696