Algorithm · Uber · Easy
Combination Count After Digit Reversal Medium · Hash Table, Math, Counting · · You are given a non‑negative integer array arr. For each element x in the array, define rev(x) as the integer obtained by reversing the decimal digits of x and discarding any leading zeros (for example, rev(123) = 321 and rev(120) = 21). From each number we calculate the difference d = x - rev(x). Return the number of distinct index pairs (i, j) with 0 <= i < j < arr.length such that arr[i] -…
Checking your access…