Is almost equal
Two strings are considered almost equal if they differ in at most 2 locations.
Write a function that would return
True
if two strings are almost equal and False
otherwise. Note that the strings might have different lengths!The input contains two strings each on a separate line.
The program should print
Yes
if they are almost equal and No
otherwise.Input | Output |
helo
helloo | No |
hello
helloo | Yes |
Constraints
Time limit: 2 seconds
Memory limit: 512 MB
Output limit: 1 MB