Similar to the examples, the file might use a marker (like a special character) followed by a number indicating how many times to repeat the next character.
(.zip, .7z, .gz, or just a raw text file?)
(e.g., was it a programming challenge?) Need to write text file and write to a compressed .zip file