Search
⌘K

Leetcode 2442. Count Number of Distinct Integers After Reverse Operations

Given an array of positive integers, append the digit-reversal of each original element (note reversing drops leading zeros, e.g., 10 -> 1) and return how many distinct values appear in the final array. Core challenge: compute reverse(x) for each number and count uniques efficiently (use a hash set; n up to 1e5, nums[i] up to 1e6).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Your account is free and you can post anonymously if you choose.