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 31, 2026 15:03skylookupskylookupScore: 523,942Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 31, 2026 15:03520,1495,748,908,2555,692,667,00028,977,0002,285,568
2Mar 31, 2026 15:03520,2205,749,455,3605,697,432,00024,984,0002,371,584
3Mar 31, 2026 15:03520,2625,750,931,6725,698,896,00023,986,0002,285,568
4Mar 31, 2026 15:03521,6215,766,311,7365,707,852,00029,978,0002,293,760
5Mar 31, 2026 15:03523,9425,793,298,8555,730,375,00032,984,0002,285,568
6Mar 31, 2026 15:03525,7805,814,188,2925,753,594,00029,987,0002,293,760
7Mar 31, 2026 15:03525,8865,816,962,6785,754,764,00029,983,0002,289,664
8Mar 31, 2026 15:03525,8945,810,455,9255,751,854,00032,981,0002,285,568
9Mar 31, 2026 15:03528,4525,840,346,3795,776,995,00035,981,0002,289,664