Count Pairs Matchable by One Digit Swap
Given an integer array nums, count the number of index pairs (i, j) such that 0 <= i < j < n and nums[i] and nums[j] can be made equal using **at most one swap of two digits within one of th...
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Standard Input
Execution Result:
