Description
Solutions
Convert Simple Password to Complex
🤘 INTERN

A company's IT department is faced with a dilemma that users keep using simple passwords such as "password", "abc123" etc.

You are tasked with a challenge to write an algorithm to identify the total minimum number of changes (insertions and deletions) of characters to convert these simple passwords to their more difficult versions.

Input

The first line of input consists of a string-currPassword, representing the current password. The second line consists of a string-newPassword, representing the new password.

Output

Print an integer representing the minimum number of updates required (character insertions and deletions) to convert the current password into the new password.

Example 1:

Input:  currPassword = "password", newPassword = "pss$w#rd"
Output: 4
Explanation:

The current password is "password" and the new password is "pss$w#rd"; we need to delete 'a' and 'o' (2 operations) and insert '$' and '#' (2 operations) to convert the current password into the new password. So, the output is 4.

Constraints:
    n/a
Thumbnail 0
Testcase

Result
Case 1

input:

output: