3265. Count Almost Equal Pairs I
You are given an array
numsconsisting of positive integers.We call two integers
xandyin this problem almost equal if both integers can become equal after performing the following operation at most once:
- Choose either
xoryand swap any two digits within the chosen number.Return the number of indices
iandjinnumswherei < jsuch thatnums[i]andnums[j]are almost equal.Note that it is allowed for an integer to have leading zeros after performing an operation.