β back to unit
Medium
# puzzle gauntlet medium
One Edit Apart
The two secret codes are SUPPOSED to be identical β check whether exactly one position went wrong. π§
You get two words a and b of the same length. Print one edit if they differ in exactly one position, identical if they match everywhere, or too different.
Example:
Input: a = "crate", b = "brate"
Output: one edit
Comparing position by position, only the first letter differs (c vs b) β exactly one mismatch.
π‘ need a hint?
pg-one-edit-apart.pyπ given lines are locked β write your code in between
loading...