/******************************************************************************
Online C# Compiler.
Code, Compile, Run and Debug C# program online.
Write your code in this editor and press "Run" button to execute it.
*******************************************************************************/
using System;
class HelloWorld {
public static bool what1(int num)
{
//1
int count = 0;
int x = num;
while (x>0)
{
int d = x % 10;
x /= 10;
count++;
}
Console.WriteLine(count);
//2
int[] C = new int[count];
int i = 0;
int f = num;
while (f > 0)
{
int d = f % 10;
C[i] = d;
i++;
f /= 10;
}
for (int k = 0; k < count; k++)
{
for (int j = k+1; j < count; j++)
{
if (C[k] == C[j])
return false;
}
}
return true;
}
public static bool what2(int num)
{
int[] C = new int[10];
while (num > 0)
{
int d = num % 10;
C[d]++;
num /= 10;
}
for (int i = 0; i < 10; i++)
{
if (C[i] > 1)
return false;
}
return true;
}
static void Main() {
Console.WriteLine("Hello World");
bool b =what2(123);
Console.WriteLine(b);
}
}