Description
Sort deletions and advance the candidate original index for each deleted position at or before it.
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.
Sort deletions and advance the candidate original index for each deleted position at or before it.
When to use this tool
Use List Stable Delete Inverse Rank when you need one item's position under an explicit list transformation.
How to use the tool and how it works
- Enter length, deleted, survivorRank. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read originalIndex. Use the output convention below.
Require unique deleted indices within length and a valid survivorRank. Sort deletions and advance the candidate original index for each deleted position at or before it.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| length | Length | Required. Safe integer; minimum 1; maximum 1000000. |
| deleted | Deleted | Required. Array of safe integer; maximum items 256. |
| survivorRank | Survivor Rank | Required. Safe integer; minimum 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| originalIndex | Original Index | Required. Safe integer. |
{
"input": {
"length": 8,
"deleted": [
1,
3
],
"survivorRank": 2
},
"output": {
"originalIndex": 4
}
} Limitations and assumptions
- All indices are zero based; at least one survivor is needed and the original list is not reconstructed.
- 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 Stride Delete Surviving Position
Mark index removed when it is at or after start on the stride progression.
- List: List Single Element Rank Shift
Map movedFrom to movedTo.