-
Notifications
You must be signed in to change notification settings - Fork 0
/
R166A.java
47 lines (36 loc) · 868 Bytes
/
R166A.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package CodeForces;
/*
*In the name of Allah the Most Merciful.
* Author
* Md. Toufiqul Islam
* Dept. Of CSE
* Ahsanullah University Of Science And Technology
*
* Codeforces, Round 166,Problem -A
*/
import java.util.HashSet;
import java.util.Scanner;
public class R166A {
public static void main(String[] arg){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
boolean isfound = false;
int i =n+1;
int total =0;
HashSet<Character> set = new HashSet<>();
while(!isfound){
String s = Integer.toString(i);
for(int j=0;j<s.length();j++){
set.add(s.charAt(j));
}
if(set.size()==4){
System.out.println(i);
break;
}
else{
i++;
set.clear();
}
}
}
}