Generate All Valid Word Abbreviations

Given a word word, generate all of its valid generalized abbreviations.

For every character, either keep it or abbreviate it. Consecutive abbreviated characters must be merged into one number.

Ret...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: