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 listJul 10, 2026 18:45Genos0Genos0Score: 52,415Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 10, 2026 18:4552,324585,148,741456,141,000119,430,0002,113,536
2Jul 10, 2026 18:4552,370585,650,376456,746,000119,331,0002,113,536
3Jul 10, 2026 18:4552,387585,753,518456,294,000119,966,0002,113,536
4Jul 10, 2026 18:4552,400585,979,775456,704,000119,696,0002,113,536
5Jul 10, 2026 18:4552,415586,113,204457,303,000119,263,0002,113,536
6Jul 10, 2026 18:4552,429586,231,838457,010,000119,710,0002,113,536
7Jul 10, 2026 18:4552,473586,819,145456,715,000120,490,0002,113,536
8Jul 10, 2026 18:4552,474588,272,597456,259,000120,959,0002,113,536
9Jul 10, 2026 18:4552,683589,066,107456,589,000122,925,0002,113,536