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 15, 2026 12:22Dominique GarmierDominique GarmierScore: 12,712Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 15, 2026 12:0612,661163,568,588137,271,0002,003,0002,289,664
2Mar 15, 2026 12:2712,662165,213,951138,285,0001,002,0002,273,280
3Mar 15, 2026 12:0612,672162,928,721138,393,0001,002,0002,281,472
4Mar 15, 2026 12:1212,673161,665,138138,400,0001,002,0002,273,280
5Mar 15, 2026 12:0612,674172,745,508138,411,0001,002,0002,289,664
6Mar 15, 2026 12:0612,678161,966,633138,456,0001,003,0002,289,664
7Mar 15, 2026 12:0612,679166,200,120138,468,0001,003,0002,379,776
8Mar 15, 2026 12:2212,681165,577,495138,491,0001,003,0002,277,376
9Mar 15, 2026 11:5912,682159,993,927138,501,0001,003,0002,289,664
10Mar 15, 2026 12:1212,685169,452,962138,536,0001,003,0002,289,664
11Mar 15, 2026 12:0612,685161,431,592138,527,0001,003,0002,289,664
12Mar 15, 2026 11:5912,690164,793,264138,590,0001,004,0002,289,664
13Mar 15, 2026 12:0612,710166,638,086138,815,000998,0002,277,376
14Mar 15, 2026 11:5912,710167,731,882139,806,00002,289,664
15Mar 15, 2026 12:1212,711170,697,049137,829,0001,997,0002,289,664
16Mar 15, 2026 11:5912,712165,238,430138,837,000998,0002,289,664
17Mar 15, 2026 12:1712,713166,918,107137,842,0001,997,0002,269,184
18Mar 15, 2026 12:1712,713163,295,876138,844,000998,0002,277,376
19Mar 15, 2026 11:5912,714164,243,973137,860,0001,997,0002,289,664
20Mar 15, 2026 12:0612,716164,247,093137,881,0001,998,0002,277,376
21Mar 15, 2026 12:2712,717170,660,056137,893,0001,998,0002,281,472
22Mar 15, 2026 12:0612,718170,954,766137,904,0001,998,0002,289,664
23Mar 15, 2026 11:5912,721165,023,071137,936,0001,999,0002,273,280
24Mar 15, 2026 11:5912,721170,265,013137,933,0001,999,0002,289,664
25Mar 15, 2026 11:5912,736168,931,333138,091,0002,001,0002,281,472
26Mar 15, 2026 12:2212,746168,297,323138,200,0002,002,0002,265,088
27Mar 15, 2026 11:5912,801170,812,907137,819,0002,996,0002,289,664
28Mar 15, 2026 12:2712,817167,222,912138,986,0001,999,0002,289,664
29Mar 15, 2026 12:1712,826175,713,073139,089,0002,001,0002,289,664
30Mar 15, 2026 12:2213,289172,494,670144,175,0002,002,0002,260,992