Problem J
Meow Factor 2

Naturally, some strings are more stylish than others, and
for cool cats it is important to engage in their string-playing
pastime with style. The meow factor of a string
-
Insert an arbitrary character anywhere into the string.
-
Delete an arbitrary character anywhere from the string.
-
Replace any character in the string by an arbitrary character.
-
Swap any two adjacent characters in the string.
Write a program to compute the meow factor of a string of characters.
Input
The input consists of a single line containing a string
Output
Output the meow factor of
Sample Input 1 | Sample Output 1 |
---|---|
pastimeofwhimsy |
1 |
Sample Input 2 | Sample Output 2 |
---|---|
yarn |
4 |