Leetcode 2430. Maximum Deletions on a String
Given a string s, repeatedly either delete the whole string or delete a prefix of length i when the first i characters equal the next i characters; compute the maximum number of such operations to delete all characters. This is solved by dynamic programming over suffixes combined with efficient substring-equality checks (n ≤ 4000) to compare adjacent blocks.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.