Skip to content

Main content

List Zip Longest Fill Budget Tool

Calculate list zip longest fill budget from explicit caller-supplied inputs.

Loading tool…

Description

Use the longest as outputLength and subtract each source length from it for fills.

Zipping lists can stop at the shortest input or extend to the longest with fill values. Those policies trade discarded tails against missing-position padding.

Use the longest as outputLength and subtract each source length from it for fills.

When to use this tool

Use List Zip Longest Fill Budget when you need to compare zip output lengths and per-list losses or fills.

How to use the tool and how it works

  1. Enter lengths. 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 outputLength, fills. Use the output convention below.

Require a nonempty list of nonnegative integer lengths. Use the longest as outputLength and subtract each source length from it for fills.1

Input fieldMeaning and unitsAccepted input
lengthsLengthsRequired. Array of safe integer; maximum items 256.
Output fieldInterpretationReturned shape
outputLengthOutput LengthRequired. Safe integer.
fillsFillsRequired. Array of safe integer; maximum items 256.
json
{
  "input": {
    "lengths": [
      3,
      5,
      4
    ]
  },
  "output": {
    "outputLength": 5,
    "fills": [
      2,
      0,
      1
    ]
  }
}

Limitations and assumptions

  • This counts required fill positions without choosing fill values or constructing zipped records.
  • 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

Choose a missing-value and alignment policy before actually combining records from unequal lists.

References

  1. Calculation and input contract: list/list-zip-longest-fill-budget — tool.io

Similar or alternative tools