#C3465. Unique Digit Checker
Unique Digit Checker
Unique Digit Checker
You are given a non-negative integer N. Your task is to determine whether all the digits in N are unique. If all digits occur exactly once, output Yes
; otherwise, output No
.
Note: N will be provided via standard input, and the answer must be printed to standard output. Ensure your solution correctly handles edge cases such as a single digit or numbers containing 0.
The uniqueness criterion can be mathematically expressed as: $$\forall \; d \in \text{digits}(N), \; count(d) = 1.$$
inputFormat
The input consists of a single line containing the integer N.
Constraints: N is a non-negative integer and can be assumed to fit in the 32-bit signed integer range.
outputFormat
Output a single line containing Yes
if all digits in the integer are unique; otherwise, output No
.
12345
Yes