← Amazon questions

Encode and decode string

Filed under Amazon

Implement run-length encoding and decoding functions. Encoding replaces consecutive repeating characters with the character followed by its count (e.g., 'aabbbba' -> 'a2b4a1'). Decoding reverses this…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.