Search
⌘K

Leetcode 471. Encode String with Shortest Length

Given a string, produce its shortest encoded form using the k[encoded_string] notation (allowing nested encodings) by replacing repeated substrings with counts. The core challenge is interval dynamic programming combined with efficient detection of repeated patterns (and choosing optimal splits/nesting) to minimize encoded length.

Asked at:

Amazon

Amazon


Question Timeline

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

Late November, 2024

Amazon

Amazon

Junior

Given a string, encode it into a specified format

Comments

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