The counts that crash the import
An importer skips malformed text but crashes on another kind of invalid count.
What’s going wrong
A batch count importer should omit invalid values without losing later valid records.
Input is a JSON array of values, at most 200. Apply Python int(value) semantics to each value; preserve successful integers in order, including zero and false converted to zero. Omit values for which conversion raises ValueError or TypeError. Values are ordinary JSON, with finite numbers only; floats truncate toward zero. Print one compact JSON array. Empty input prints []. Do not turn invalid values into zero or stop the batch at the first bad record.
Expected behavior
Partition input failures by cause while preserving valid falsey results.
Reproduction
["4",null,"bad","0"]
[4,0]
["2","-3",7]
[2,-3,7]
["7","bad","8"]
[7,8]
Before you begin
- Python lists and dictionaries
Need a nudge?
Reveal one investigation hint at a time. Try each clue before opening the next.
Read the report, then sign in to start your investigation.