Skip to content

Main content

Duplicate Run Internal Edge Count Tool

Count adjacent equal-value edges from explicit maximal duplicate-run lengths.

Loading tool…

Description

Sum runLength minus one across positive integer runLengths using exact integer intermediates, then return the numeric internalEdges.

A run is a consecutive group of equal values. Its internal adjacencies and boundary relationships differ from counts of distinct values across a whole list.

Sum runLength minus one across positive integer runLengths using exact integer intermediates, then return the numeric internalEdges.

When to use this tool

Use Duplicate Run Internal Edge Count when you need one run boundary or adjacency calculation.

How to use the tool and how it works

  1. Enter runLengths. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read internalEdges. Use the output convention below.

Sum runLength minus one across positive integer runLengths using exact integer intermediates, then return the numeric internalEdges.1

Input fieldMeaning and unitsAccepted input
runLengthsRun LengthsRequired. Array of safe integer; maximum items 256.
Output fieldInterpretationReturned shape
internalEdgesInternal EdgesRequired. Safe integer.
json
{
  "input": {
    "runLengths": [
      3,
      1,
      2
    ]
  },
  "output": {
    "internalEdges": 3
  }
}

Limitations and assumptions

  • This counts adjacencies within runs, not boundaries between runs; values and maximality of runs are not verified.
  • 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.

Alternative or Complementary methods

Use a complete run-length scan when maximal runs and their values need to be constructed or verified.

References

  1. Calculation and input contract: list/duplicate-run-internal-edge-count — tool.io

Similar or alternative tools