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
Date AuthorLanguageStatus Score
Apr 16, 2026 08:50limanjun99limanjun99CPPg++13.3.0Success4,894
Apr 16, 2026 08:44limanjun99limanjun99CPPg++13.3.0Success4,760+57.10 RP
Apr 16, 2026 08:31limanjun99limanjun99CPPg++13.3.0Success4,893+30.85 RP
Apr 16, 2026 08:28limanjun99limanjun99CPPg++13.3.0Success5,110
Apr 16, 2026 08:24limanjun99limanjun99CPPg++13.3.0Success5,151
Apr 16, 2026 08:02olliecrowolliecrowCPPg++13.3.0Error
Apr 16, 2026 08:00olliecrowolliecrowCPPg++13.3.0Error
Apr 16, 2026 07:57olliecrowolliecrowCPPg++13.3.0Error
Apr 16, 2026 07:55limanjun99limanjun99CPPg++13.3.0Success4,968+127.87 RP
Apr 16, 2026 07:43olliecrowolliecrowCPPg++13.3.0Error
Apr 16, 2026 07:41olliecrowolliecrowCPPg++13.3.0Error
Apr 16, 2026 07:39olliecrowolliecrowCPPg++13.3.0Error
Apr 16, 2026 07:36olliecrowolliecrowCPPg++13.3.0Error
Apr 16, 2026 07:30olliecrowolliecrowCPPg++13.3.0Error
Apr 16, 2026 07:29limanjun99limanjun99CPPg++13.3.0Success5,309
Apr 16, 2026 07:28limanjun99limanjun99CPPg++13.3.0Error
Apr 16, 2026 07:26limanjun99limanjun99CPPg++13.3.0Error
Apr 16, 2026 07:23limanjun99limanjun99CPPg++13.3.0Error
Apr 16, 2026 07:21limanjun99limanjun99CPPg++13.3.0Error
Apr 16, 2026 07:18olliecrowolliecrowCPPg++13.3.0Error
Apr 16, 2026 07:15olliecrowolliecrowCPPg++13.3.0Error
Apr 16, 2026 05:56limanjun99limanjun99CPPg++13.3.0Success5,305+1'868.63 RP
Apr 16, 2026 05:45limanjun99limanjun99CPPg++13.3.0Error
Apr 16, 2026 05:42limanjun99limanjun99CPPg++13.3.0Success610,350+16.38 RP
Apr 16, 2026 05:18olliecrowolliecrowCPPg++13.3.0Success3,176
Apr 16, 2026 03:58limanjun99limanjun99CPPg++13.3.0Error
Apr 16, 2026 03:52limanjun99limanjun99CPPg++13.3.0Error
Apr 16, 2026 03:24olliecrowolliecrowRUSTrust-1.94.0Success3,314
Apr 16, 2026 03:05olliecrowolliecrowRUSTrust-1.94.0Success3,356
Apr 16, 2026 02:46olliecrowolliecrowRUSTrust-1.94.0Error
Apr 16, 2026 02:44olliecrowolliecrowCPPg++13.3.0Success3,147
Apr 16, 2026 02:26olliecrowolliecrowCPPg++13.3.0Success3,170
Apr 16, 2026 02:23olliecrowolliecrowCPPg++13.3.0Success3,169
Apr 16, 2026 02:11olliecrowolliecrowCPPg++13.3.0Error
Apr 16, 2026 02:08olliecrowolliecrowCPPg++13.3.0Error
Apr 16, 2026 01:53olliecrowolliecrowCPPg++13.3.0Success3,187
Apr 16, 2026 01:51olliecrowolliecrowCPPg++13.3.0Success3,170
Apr 15, 2026 04:00olliecrowolliecrowGOgo1.26.1Success7,623
Apr 14, 2026 07:19olliecrowolliecrowZIG0.14.0Error
Apr 14, 2026 07:15olliecrowolliecrowZIG0.14.0Error
Apr 14, 2026 06:55olliecrowolliecrowZIG0.14.0Error
Apr 14, 2026 06:52olliecrowolliecrowZIG0.14.0Error
Apr 14, 2026 00:57olliecrowolliecrowZIG0.14.0Error
Apr 13, 2026 00:02olliecrowolliecrowGOgo1.26.1Error
Apr 12, 2026 21:06olliecrowolliecrowGOgo1.26.1Error
Apr 12, 2026 14:25olliecrowolliecrowCSHARP9.0.14Error
Apr 12, 2026 13:00olliecrowolliecrowCSHARP9.0.14Error
Apr 12, 2026 02:09olliecrowolliecrowCSHARP9.0.14Error
Apr 10, 2026 10:05olliecrowolliecrowGOgo1.26.1Error
Apr 9, 2026 21:29olliecrowolliecrowCSHARP9.0.14Error
Apr 9, 2026 21:25olliecrowolliecrowCSHARP9.0.14Error
Apr 9, 2026 21:21olliecrowolliecrowCSHARP9.0.14Error
Apr 9, 2026 19:39olliecrowolliecrowCSHARP9.0.14Error
Apr 9, 2026 19:31olliecrowolliecrowCSHARP9.0.14Error
Apr 9, 2026 17:13olliecrowolliecrowGOgo1.26.1Error
Apr 9, 2026 17:09olliecrowolliecrowGOgo1.26.1Error
Apr 9, 2026 17:06olliecrowolliecrowGOgo1.26.1Error
Apr 9, 2026 16:58olliecrowolliecrowCSHARP9.0.14Error
Apr 9, 2026 16:54olliecrowolliecrowCSHARP9.0.14Error
Apr 9, 2026 16:50olliecrowolliecrowCSHARP9.0.14Error
Apr 9, 2026 15:38olliecrowolliecrowCPPg++13.3.0Success3,228
Apr 9, 2026 15:16olliecrowolliecrowZIG0.14.0Error
Apr 9, 2026 15:11olliecrowolliecrowZIG0.14.0Error
Apr 9, 2026 15:09olliecrowolliecrowZIG0.14.0Error
Apr 9, 2026 15:06olliecrowolliecrowZIG0.14.0Error
Apr 9, 2026 11:32olliecrowolliecrowCSHARP9.0.14Error
Apr 9, 2026 11:28olliecrowolliecrowCSHARP9.0.14Error
Apr 9, 2026 11:25olliecrowolliecrowCSHARP9.0.14Error
Apr 9, 2026 10:46olliecrowolliecrowZIG0.14.0Error
Apr 9, 2026 10:43olliecrowolliecrowZIG0.14.0Error
Apr 9, 2026 10:41olliecrowolliecrowZIG0.14.0Error
Apr 9, 2026 10:31olliecrowolliecrowGOgo1.26.1Error
Apr 9, 2026 10:29olliecrowolliecrowGOgo1.26.1Error
Apr 9, 2026 10:26olliecrowolliecrowGOgo1.26.1Error
Apr 9, 2026 09:36olliecrowolliecrowCPPg++13.3.0Error
Apr 9, 2026 09:32olliecrowolliecrowCPPg++13.3.0Error
Apr 9, 2026 09:27olliecrowolliecrowZIG0.14.0Error
Apr 9, 2026 09:24olliecrowolliecrowZIG0.14.0Error
Apr 9, 2026 09:18olliecrowolliecrowZIG0.14.0Error
Apr 9, 2026 08:56olliecrowolliecrowCPPg++13.3.0Error
Apr 9, 2026 08:55olliecrowolliecrowCPPg++13.3.0Error
Apr 9, 2026 08:54olliecrowolliecrowCPPg++13.3.0Error
Apr 9, 2026 08:54olliecrowolliecrowCPPg++13.3.0Error
Apr 9, 2026 08:53olliecrowolliecrowCPPg++13.3.0Error
Apr 9, 2026 08:51olliecrowolliecrowCPPg++13.3.0Error
Apr 9, 2026 08:50olliecrowolliecrowCPPg++13.3.0Error
Apr 9, 2026 08:50olliecrowolliecrowCPPg++13.3.0Error
Apr 9, 2026 08:49olliecrowolliecrowCPPg++13.3.0Error
Apr 9, 2026 08:49olliecrowolliecrowCPPg++13.3.0Error
Apr 9, 2026 08:48olliecrowolliecrowCPPg++13.3.0Error
Apr 9, 2026 08:45olliecrowolliecrowCPPg++13.3.0Error
Apr 9, 2026 08:45olliecrowolliecrowCPPg++13.3.0Error
Apr 9, 2026 08:44olliecrowolliecrowCPPg++13.3.0Error
Apr 9, 2026 08:44olliecrowolliecrowCPPg++13.3.0Error
Apr 9, 2026 08:43olliecrowolliecrowCPPg++13.3.0Error
Apr 9, 2026 08:43olliecrowolliecrowCPPg++13.3.0Error
Apr 9, 2026 08:40olliecrowolliecrowCPPg++13.3.0Error
Apr 9, 2026 08:39olliecrowolliecrowCPPg++13.3.0Error
Apr 9, 2026 08:39olliecrowolliecrowCPPg++13.3.0Error
Apr 9, 2026 08:38olliecrowolliecrowCPPg++13.3.0Error