Description
Return -1 and removed true for selected deletion; otherwise subtract the number of deletions before selected.
An index map tracks where one item lands after a structural list operation. Zero-based element positions differ from boundary cursors, and missing destinations need a sentinel.
Return -1 and removed true for selected deletion; otherwise subtract the number of deletions before selected.
When to use this tool
Use List Delete Selected Index Map when you need one item's position under an explicit list transformation.
How to use the tool and how it works
- Enter length, deleted, selected. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read newIndex, removed. Inspect removed before interpreting the associated values.
Require unique valid deleted indices. Return -1 and removed true for selected deletion; otherwise subtract the number of deletions before selected.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| length | Length, count, or code length under the stated domain and unit convention. | Required. Safe integer; minimum 1. |
| deleted | Deleted | Required. Array of safe integer; maximum items 256. |
| selected | Selected | Required. Safe integer; minimum 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| newIndex | New Index | Required. Safe integer. |
| removed | Removed | Required. Boolean. |
{
"input": {
"length": 6,
"deleted": [
1,
3
],
"selected": 4
},
"output": {
"newIndex": 2,
"removed": false
}
} Limitations and assumptions
- This maps one survivor rather than rebuilding the list; deletion order does not affect the count.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Apply the operation to a small representative list when checking a consuming language's indexing and slicing semantics.
References
Similar or alternative tools
- List Insert Delete Index Roundtrip
Shift selected right when at or beyond insertedAt.
- List Gather Duplicate Index Flag
Record each repeated index once in the order its repetition is first encountered.