Algorithm · Uber · Medium
Digit-Reverse Equivalent Pairs Medium · Topics · Company Tags · Hints You are given an array of positive integers nums. Define a function rev(x) that takes an integer, reverses the order of its decimal digits, and removes any leading zeros from the reversed form. For instance, rev(800) = 8 and rev(210) = 12. A pair of indices (i, j) (with i and j inside the array bounds) is called valid when nums[i] + rev(nums[j]) == nums[j] + rev(nums[i]). Count the total number of valid…
Checking your access…