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
| Date | Challenger | Cost | Type | Status |
|---|---|---|---|---|
| Sep 8, 2026 07:35 | C#_user | 10.00 | Custom | Solution Broken |
Run Statistics
| # | Date | Score | Wall Time | CPU User | CPU System | Memory | Error | |
|---|---|---|---|---|---|---|---|---|
| 1 | Sep 8, 2026 07:35 | 0 | 62,443,311 | 52,588,000 | 1,185,000 | 2,138,112 | expected "2 ", got "0 " | |
| 2 | Sep 8, 2026 07:35 | 0 | 62,074,253 | 52,386,000 | 1,165,000 | 2,138,112 | expected "2 ", got "0 " | |
| 3 | Sep 8, 2026 07:35 | 0 | 61,777,717 | 52,160,000 | 1,083,000 | 2,138,112 | expected "2 ", got "0 " | |
| 4 | Jun 20, 2021 14:44 | 11,851 | 153,045,416 | 128,359,000 | 2,005,000 | 2,330,624 | ||
| 5 | Jun 20, 2021 14:50 | 11,863 | 157,058,340 | 128,482,000 | 2,007,000 | 2,510,848 | ||
| 6 | Jun 20, 2021 14:50 | 11,864 | 157,678,304 | 128,497,000 | 2,007,000 | 2,506,752 | ||
| 7 | Jun 20, 2021 14:44 | 11,869 | 153,483,798 | 128,553,000 | 2,008,000 | 2,510,848 | ||
| 8 | Jun 20, 2021 14:42 | 11,870 | 161,139,712 | 128,563,000 | 2,008,000 | 2,514,944 | ||
| 9 | Jun 20, 2021 14:42 | 11,871 | 153,004,158 | 128,569,000 | 2,008,000 | 2,510,848 | ||
| 10 | Jun 20, 2021 14:42 | 11,873 | 157,627,683 | 128,593,000 | 2,009,000 | 2,330,624 | ||
| 11 | Jun 20, 2021 14:42 | 11,875 | 164,178,490 | 128,619,000 | 2,009,000 | 2,330,624 | ||
| 12 | Jun 20, 2021 14:50 | 11,875 | 159,324,706 | 128,615,000 | 2,009,000 | 2,330,624 | ||
| 13 | Jun 20, 2021 14:44 | 11,876 | 155,476,329 | 129,634,000 | 1,004,000 | 2,310,144 | ||
| 14 | Jun 20, 2021 14:42 | 11,880 | 155,689,388 | 129,670,000 | 1,005,000 | 2,330,624 | ||
| 15 | Jun 20, 2021 14:44 | 11,880 | 159,722,815 | 129,672,000 | 1,005,000 | 2,502,656 | ||
| 16 | Jun 20, 2021 14:44 | 11,880 | 161,589,018 | 128,667,000 | 2,010,000 | 2,330,624 | ||
| 17 | Jun 20, 2021 14:42 | 11,881 | 158,769,100 | 128,698,000 | 1,995,000 | 2,326,528 | ||
| 18 | Jun 20, 2021 14:42 | 11,887 | 203,789,646 | 130,759,913 | 0 | 2,187,264 | ||
| 19 | Jun 20, 2021 14:50 | 11,888 | 195,924,078 | 130,767,627 | 0 | 2,191,360 | ||
| 20 | Jun 20, 2021 14:50 | 11,889 | 203,027,984 | 130,774,212 | 0 | 2,179,072 | ||
| 21 | Jun 20, 2021 14:50 | 11,890 | 153,958,076 | 127,790,000 | 2,995,000 | 2,506,752 | ||
| 22 | Jun 20, 2021 14:44 | 11,894 | 162,658,144 | 128,835,000 | 1,997,000 | 2,519,040 | ||
| 23 | Jun 20, 2021 14:42 | 11,895 | 163,646,080 | 128,847,000 | 1,997,000 | 2,514,944 | ||
| 24 | Jun 20, 2021 14:42 | 11,895 | 157,537,324 | 129,850,000 | 998,000 | 2,330,624 | ||
| 25 | Jun 20, 2021 14:42 | 11,895 | 159,038,933 | 128,853,000 | 1,997,000 | 2,502,656 | ||
| 26 | Jun 20, 2021 14:50 | 11,895 | 155,501,624 | 128,847,000 | 1,997,000 | 2,506,752 | ||
| 27 | Jun 20, 2021 14:50 | 11,895 | 155,131,209 | 128,846,000 | 1,997,000 | 2,375,680 | ||
| 28 | Jun 20, 2021 14:44 | 11,898 | 155,366,345 | 127,879,000 | 2,997,000 | 2,514,944 | ||
| 29 | Jun 20, 2021 14:44 | 11,899 | 154,145,733 | 127,887,000 | 2,997,000 | 2,330,624 | ||
| 30 | Jun 20, 2021 14:50 | 11,900 | 164,822,090 | 128,902,000 | 1,998,000 | 2,510,848 | ||
| 31 | Jun 20, 2021 14:42 | 11,903 | 198,248,267 | 130,938,000 | 0 | 2,179,072 | ||
| 32 | Jun 20, 2021 14:44 | 11,903 | 190,658,236 | 130,930,631 | 0 | 2,187,264 | ||
| 33 | Jun 20, 2021 14:50 | 11,903 | 159,345,479 | 127,934,000 | 2,998,000 | 2,330,624 | ||
| 34 | Jun 20, 2021 14:44 | 11,906 | 198,247,638 | 130,962,011 | 0 | 2,187,264 | ||
| 35 | Jun 20, 2021 14:44 | 11,910 | 157,429,280 | 129,012,000 | 2,000,000 | 2,510,848 | ||
| 36 | Jun 20, 2021 14:50 | 11,915 | 153,654,979 | 129,062,000 | 2,000,000 | 2,506,752 | ||
| 37 | Jun 20, 2021 14:44 | 11,916 | 191,115,039 | 131,076,459 | 0 | 2,187,264 | ||
| 38 | Jun 20, 2021 14:42 | 11,917 | 196,554,101 | 131,091,581 | 0 | 2,183,168 | ||
| 39 | Jun 20, 2021 14:50 | 11,917 | 200,019,335 | 131,087,655 | 0 | 2,187,264 |