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 listApr 22, 2026 11:18olliecrowolliecrowScore: 3,963Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 22, 2026 11:193,88249,504,47241,687,0001,016,0002,318,336
2Apr 22, 2026 11:193,90249,485,96440,935,0001,996,0002,330,624
3Apr 22, 2026 11:193,91249,628,24842,040,0001,000,0002,330,624
4Apr 22, 2026 11:193,95549,359,39441,487,0002,023,0002,330,624
5Apr 22, 2026 11:193,96349,432,75941,570,0002,027,0002,330,624
6Apr 22, 2026 11:193,96549,353,95741,587,0002,028,0002,486,272
7Apr 22, 2026 11:193,96549,370,81742,579,0001,038,0002,473,984
8Apr 22, 2026 11:193,96649,493,18941,604,0002,029,0002,318,336
9Apr 22, 2026 11:193,97449,425,03941,683,0002,033,0002,330,624