시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 (추가 시간 없음) | 512 MB | 86 | 48 | 42 | 54.545% |
The Levenshtein Distance between two strings is the smallest number of simple one-letter operations needed to change one string to the other. The operations are:
Given a specific alphabet and a particular query string, find all other unique strings from that alphabet that are at a Levenshtein Distance of 1 from the given string, and list them in alphabetical order, with no duplicates.
Note that the query string must not be in the list. Its Levenshtein Distance from itself is 0, not 1.
Input consists of exactly two lines. The first line of input contains a sequence of unique lower-case letters, in alphabetical order, with no spaces between them. This is the alphabet to use.
The second line contains a string s (2 ≤ |s| ≤ 100), which consists only of lower-case letters from the given alphabet. This is the query string.
Output a list, in alphabetical order, of all strings which are a Levenshtein Distance of 1 from the query string 𝒔. Output one word per line, with no duplicates.
eg egg
eeg eegg eg ege egeg egge eggg gegg gg ggg
ICPC > Regionals > North America > Southeast USA Regional > 2019 Southeast USA Regional Programming Contest > Division 1 H번
ICPC > Regionals > North America > Southeast USA Regional > 2019 Southeast USA Regional Programming Contest > Division 2 I번
ICPC > Regionals > North America > Pacific Northwest Regional > 2019 ICPC Pacific Northwest Region > Division 2 V번