Back to problems

Minimum Insertions / Deletions Password Update

Algorithm · Cisco · Medium

Requirements The first line of input is currPassword, the current password. The second line of input is newPassword, the desired password. You may only insert or delete characters — no replacements are allowed. Return the smallest number of insertions and deletions needed to turn currPassword into newPassword. The function signature is: Examples Input: Output: Explanation: Remove a and o, then add $ and # — four operations total. Notes This is an edit‑distance problem where…

Checking your access…