cswork / OA打开练习工作台

CiscoOA #5

Minimum Password Update Operations

估计中等可在线判题

考点(AI 标注)子序列字符串动规

Transform the current password into the target password. Each operation inserts or deletes exactly one character, and a substitution cannot count as a single operation. Characters cannot be reordered; all characters are counted by Unicode code point, and whitespace, NUL, emoji, and case differences are preserved.

输入格式

Two lines, each a JSON string, giving the current and target passwords in order; for example, the empty string is written as "", NUL as \u0000, and a newline character as \n. Strings are not split on whitespace. The original gave no bounds on length, character domain, or non-emptiness; this site adds 0..1000 Unicode scalar characters per string. The source C++ getline also supports spaces.

输出格式

Output a single integer, the answer.

样例 1

输入:

"password"
"pss$w#rd"

输出:

4

样例 2

输入:

"a"
"A"

输出:

2

样例 3

输入:

""
"\u0000 😀"

输出:

3

样例说明

The outputs of the three public examples are, in order: 4; 2; 3. Verified by independent enumeration or direct simulation.