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 listAug 14, 2026 12:12marko1597marko1597Error
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 4, 2026 11:21Tomislav Tunkovic194.82CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 4, 2026 11:22065,435,07754,518,0001,053,0002,113,536expected "405642745 ", got "80519353158 "
2Sep 4, 2026 11:22065,604,90854,665,0001,046,0002,113,536expected "405641933 ", got "85547029513 "
3Sep 4, 2026 11:22065,483,96854,539,0001,021,0002,113,536expected "404411277 ", got "76151227627 "
4Aug 14, 2026 12:134,70361,571,24350,716,0001,023,0002,113,536
5Aug 14, 2026 12:134,70561,579,47750,691,0001,069,0002,113,536
6Aug 14, 2026 12:134,70761,595,01250,731,0001,056,0002,113,536
7Aug 14, 2026 12:134,71161,727,91750,750,0001,073,0002,113,536
8Aug 14, 2026 12:134,71461,706,33850,836,0001,025,0002,113,536
9Aug 14, 2026 12:134,71461,654,92050,840,0001,019,0002,113,536
10Aug 14, 2026 12:134,72561,841,30050,890,0001,091,0002,113,536
11Aug 14, 2026 12:134,72861,819,03550,935,0001,075,0002,113,536
12Aug 14, 2026 12:134,73773,035,09550,939,0001,176,0002,113,536