{ "exercise": "run-length-encoding", "version": "1.0.0", "cases": [ { "description": "run-length encode a string", "cases": [ { "description": "empty string", "property": "encode", "input": "", "expected": "" }, { "description": "single characters only are encoded without count", "property": "encode", "input": "XYZ", "expected": "XYZ" }, { "description": "string with no single characters", "property": "encode", "input": "AABBBCCCC", "expected": "2A3B4C" }, { "description": "single characters mixed with repeated characters", "property": "encode", "input": "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB", "expected": "12WB12W3B24WB" }, { "description": "multiple whitespace mixed in string", "property": "encode", "input": " hsqq qww ", "expected": "2 hs2q q2w2 " }, { "description": "lowercase characters", "property": "encode", "input": "aabbbcccc", "expected": "2a3b4c" } ] }, { "description": "run-length decode a string", "cases": [ { "description": "empty string", "property": "decode", "input": "", "expected": "" }, { "description": "single characters only", "property": "decode", "input": "XYZ", "expected": "XYZ" }, { "description": "string with no single characters", "property": "decode", "input": "2A3B4C", "expected": "AABBBCCCC" }, { "description": "single characters with repeated characters", "property": "decode", "input": "12WB12W3B24WB", "expected": "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB" }, { "description": "multiple whitespace mixed in string", "property": "decode", "input": "2 hs2q q2w2 ", "expected": " hsqq qww " }, { "description": "lower case string", "property": "decode", "input": "2a3b4c", "expected": "aabbbcccc" } ] }, { "description": "encode and then decode", "cases": [ { "description": "encode followed by decode gives original string", "property": "consistency", "input": "zzz ZZ zZ", "expected": "zzz ZZ zZ" } ] } ] }