Problem Summary
Given two strings, A and B, determine if it is possible that B is an abbreviation for A.
Solution
This is a classic dynamic programming problem.
Let f[i,j] = true if the first j letters of B can be an abbreviation for the first i letters of A, and f[i,j] = false otherwise.
Code
|
|