Parse JSON 
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.canceledisfalseor absent
Source Code
Source code access is restricted. Log in to request access.
Challenge History
No challenges yet.
Run Statistics
| # | Date | Score | Wall Time | CPU User | CPU System | Memory | Error | |
|---|---|---|---|---|---|---|---|---|
| 1 | Sep 27, 2025 08:34 | 17,935 | 220,732,171 | 173,247,000 | 24,034,000 | 2,355,200 | ||
| 2 | Sep 27, 2025 08:34 | 17,941 | 226,306,009 | 174,315,000 | 23,041,000 | 2,523,136 | ||
| 3 | Sep 27, 2025 08:34 | 17,951 | 223,360,089 | 175,413,000 | 22,052,000 | 2,424,832 | ||
| 4 | Sep 27, 2025 08:34 | 17,952 | 229,881,612 | 174,422,000 | 23,055,000 | 2,338,816 | ||
| 5 | Sep 27, 2025 08:34 | 17,965 | 224,692,000 | 174,663,000 | 22,955,000 | 2,334,720 | ||
| 6 | Sep 27, 2025 08:34 | 17,972 | 229,481,195 | 174,732,000 | 22,964,000 | 2,326,528 | ||
| 7 | Sep 27, 2025 08:34 | 17,974 | 228,376,413 | 176,742,000 | 20,969,000 | 2,400,256 | ||
| 8 | Sep 27, 2025 08:34 | 17,975 | 224,755,932 | 171,758,000 | 25,963,000 | 2,433,024 | ||
| 9 | Sep 27, 2025 08:34 | 17,990 | 221,432,140 | 176,905,000 | 20,988,000 | 2,404,352 | ||
| 10 | Sep 27, 2025 08:34 | 17,990 | 220,716,468 | 181,903,000 | 15,991,000 | 2,334,720 | ||
| 11 | Sep 27, 2025 08:34 | 17,993 | 224,725,783 | 181,930,000 | 15,993,000 | 2,404,352 | ||
| 12 | Sep 27, 2025 08:34 | 17,995 | 222,583,264 | 170,953,000 | 26,992,000 | 2,412,544 | ||
| 13 | Sep 27, 2025 08:34 | 17,996 | 226,962,080 | 174,958,000 | 22,994,000 | 2,400,256 | ||
| 14 | Sep 27, 2025 08:34 | 18,001 | 224,613,550 | 179,007,000 | 19,000,000 | 2,465,792 | ||
| 15 | Sep 27, 2025 08:34 | 18,009 | 220,296,992 | 173,085,000 | 25,012,000 | 2,494,464 | ||
| 16 | Sep 27, 2025 08:34 | 18,015 | 221,030,296 | 175,149,000 | 23,019,000 | 2,416,640 | ||
| 17 | Sep 27, 2025 08:34 | 18,015 | 220,822,591 | 175,149,000 | 23,019,000 | 2,408,448 | ||
| 18 | Sep 27, 2025 08:34 | 18,017 | 224,221,816 | 179,168,000 | 19,017,000 | 2,351,104 | ||
| 19 | Sep 27, 2025 08:34 | 18,018 | 221,141,065 | 177,180,000 | 21,021,000 | 2,457,600 | ||
| 20 | Sep 27, 2025 08:34 | 18,021 | 220,582,168 | 177,202,000 | 21,024,000 | 2,322,432 | ||
| 21 | Sep 27, 2025 08:34 | 18,022 | 220,458,912 | 175,218,000 | 23,028,000 | 2,342,912 | ||
| 22 | Sep 27, 2025 08:34 | 18,024 | 220,264,458 | 172,229,000 | 26,034,000 | 2,486,272 | ||
| 23 | Sep 27, 2025 08:34 | 18,025 | 223,415,556 | 180,248,000 | 18,024,000 | 2,347,008 | ||
| 24 | Sep 27, 2025 08:34 | 18,026 | 221,493,165 | 181,257,000 | 17,024,000 | 2,322,432 | ||
| 25 | Sep 27, 2025 08:34 | 18,030 | 219,282,174 | 175,289,000 | 23,038,000 | 2,461,696 | ||
| 26 | Sep 27, 2025 08:34 | 18,039 | 220,865,165 | 174,382,000 | 24,052,000 | 2,383,872 | ||
| 27 | Sep 27, 2025 08:34 | 18,042 | 228,855,463 | 176,409,000 | 22,051,000 | 2,404,352 | ||
| 28 | Sep 27, 2025 08:34 | 18,043 | 225,430,324 | 177,422,000 | 21,050,000 | 2,379,776 | ||
| 29 | Sep 27, 2025 08:34 | 18,051 | 231,072,904 | 167,473,000 | 31,087,000 | 2,334,720 | ||
| 30 | Sep 27, 2025 08:34 | 18,052 | 229,034,217 | 174,626,000 | 23,948,000 | 2,396,160 | ||
| 31 | Sep 27, 2025 08:34 | 18,053 | 224,818,576 | 178,627,000 | 19,958,000 | 2,510,848 | ||
| 32 | Sep 27, 2025 08:34 | 18,054 | 223,452,610 | 172,513,000 | 26,077,000 | 2,363,392 | ||
| 33 | Sep 27, 2025 08:34 | 18,055 | 226,526,920 | 174,536,000 | 24,074,000 | 2,334,720 | ||
| 34 | Sep 27, 2025 08:34 | 18,059 | 226,295,964 | 180,684,000 | 17,968,000 | 2,392,064 | ||
| 35 | Sep 27, 2025 08:34 | 18,065 | 224,443,970 | 177,746,000 | 20,970,000 | 2,330,624 | ||
| 36 | Sep 27, 2025 08:34 | 18,067 | 228,874,934 | 176,770,000 | 21,971,000 | 2,461,696 | ||
| 37 | Sep 27, 2025 08:34 | 18,069 | 225,952,368 | 182,777,000 | 15,980,000 | 2,269,184 | ||
| 38 | Sep 27, 2025 08:34 | 18,073 | 226,733,738 | 177,717,000 | 21,085,000 | 2,359,296 | ||
| 39 | Sep 27, 2025 08:34 | 18,074 | 223,055,374 | 177,836,000 | 20,980,000 | 2,351,104 | ||
| 40 | Sep 27, 2025 08:34 | 18,088 | 221,693,473 | 172,969,000 | 25,995,000 | 2,387,968 | ||
| 41 | Sep 27, 2025 08:34 | 18,089 | 221,850,553 | 178,985,000 | 19,998,000 | 2,363,392 | ||
| 42 | Sep 27, 2025 08:34 | 18,094 | 224,829,697 | 184,028,000 | 15,002,000 | 2,326,528 | ||
| 43 | Sep 27, 2025 08:34 | 18,097 | 227,993,077 | 173,061,000 | 26,009,000 | 2,371,584 | ||
| 44 | Sep 27, 2025 08:34 | 18,112 | 220,744,593 | 178,206,000 | 21,024,000 | 2,400,256 | ||
| 45 | Sep 27, 2025 08:34 | 18,125 | 220,580,190 | 176,328,000 | 23,042,000 | 2,404,352 |