Save 25%Black Friday: 25% off all plans — use code BLACKFRIDAY2026 at checkout. Ends Monday, Dec 7.Claim the deal

Given an array of non-negative integers, design an encoder and decoder that compresses the sequence into a human-readable list of run descriptors and can restore it back to the original array, using two types of runs: Run-Length Encoding (RLE) and Bit-Packing (BP).

The encoder outputs a list of strings, each representing a run in one of the following formats:

  1. RLE Run: Consecutive identical values are represented as "RLE[value, count]", where:
Stdout
-