Functions
Function-41
Function-42
Function-43
~/algor $ cat problems/funksiya-raqamlari-har-xil
Number with distinct digits
Easy
2000 ms
128 MB
31%
Write a function HasDistinctDigits(x) that returns true if all digits of the positive integer $x$ are different and false otherwise.
Example 1: HasDistinctDigits(1234) → true
Example 2: HasDistinctDigits(1213) → false — the digit $1$ occurs twice.
Write only the function body.
Input
One line with a positive integer $x$ — the argument of the function.
Output
The value returned by the function: true or false.
Note
$1 \le x \le 10^{6}$
Examples
Input #1
1234
Output #1
true
Input #2
1213
Output #2
false