Search
⌘K

Leetcode 443. String Compression

Compress an array of characters in-place by replacing each run of consecutive identical characters with the character followed by its run length (omit the length when it is 1), returning the new length; you must use only O(1) extra space and handle multi-digit counts as separate characters.

Asked at:

Morgan Stanley

Morgan Stanley


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Early January, 2026

Morgan Stanley

Morgan Stanley

Mid-level

Comments

Your account is free and you can post anonymously if you choose.