Company: Autodesk_14oct
Difficulty: medium
Single Digit Difference Pairs Problem Description You have intercepted a list of access codes, stored as an array codes of positive integers. Some codes look like copies of one another in which a single digit has been corrupted. Two codes form a single digit difference pair when, written in decimal: they have the same number of digits , and they disagree in exactly one digit position (positions are compared left to right, the first digit with the first digit, the second with the second, and so on). Complete the function solution(codes) . It returns the number of index pairs (i, j) with 0 <= i < j < codes.length such that codes[i] and codes[j] form a single digit difference pair. Codes with different numbers of digits are never compared; they are not padded with leading zeros. Two equal codes disagree in zero positions, so they never form a pair. The count is over index pairs, so a value that appears several times takes part in a pair once for each of its copies. Input Format R