Tap here to switch tabs
Problem
Submissions

Problem: Count Distinct Integers After Reverse Operations

Count Distinct Integers After Reverse Operations gives a positive integer array. Append each number's digit reversal and return the unique-value count, with leading zeros removed.

Statement

You are given an array nums of positive integers.

You must take the reverse of the digits of each integer in the array and append it to the end of nums.

Return the total number of distinct integers present in the resulting array.

Note: Reversing an integer removes any leading zeros (for example, reversing 1010 results in 11).

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • 1≤1 \leq nums[i] ≤106\leq 10^6

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count Distinct Integers After Reverse Operations

Count Distinct Integers After Reverse Operations gives a positive integer array. Append each number's digit reversal and return the unique-value count, with leading zeros removed.

Statement

You are given an array nums of positive integers.

You must take the reverse of the digits of each integer in the array and append it to the end of nums.

Return the total number of distinct integers present in the resulting array.

Note: Reversing an integer removes any leading zeros (for example, reversing 1010 results in 11).

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • 1≤1 \leq nums[i] ≤106\leq 10^6