Skip to content

Practice Count Number of Distinct Integers After Reverse Operations

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Medium#2442
LeetCode Problem

Count Number of Distinct Integers After Reverse Operations

Problem Statement

You are given an array nums consisting of positive integers. You have to take each integer in the array, reverse its digits, and add it to the end of the array. You should apply this operation to the original integers in nums. Return the number of distinct integers in the final array.

Source: Count Number of Distinct Integers After Reverse Operations on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
nums = [1,13,10,12,31]
Output
6

# Example 2

Input
nums = [2,2,2]
Output
1

Constraints

1 <= nums.length <= 10^5
1 <= nums[i] <= 10^6

Related LeetCode Problems

Practice more problems similar to Count Number of Distinct Integers After Reverse Operations.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.