python
beginner
解決済み
2026-11-17 終了
Run-length encoding
Write two functions:
encode(text)turns runs of the same character into count + character:"aaabcc"becomes"3a1b2c".decode(data)reverses it:"3a1b2c"becomes"aaabcc". Counts can have several digits ("12x").
Acceptance criteria
decode(encode(s)) == sfor any text without digits.- Empty input gives empty output.
- The tests at the bottom print
All tests passed.
これまでに 0 人が解きました。
エディターCtrl + Enter
テストが "All tests passed" と表示すると、このブラウザーでチャレンジが解決済みになります。
解答をレビューに提出