- Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathFormattedNumber.java
40 lines (25 loc) · 808 Bytes
/
FormattedNumber.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
importjava.util.*;
importjava.io.*;
classMain {
publicstaticStringStringChallenge(Stringstr) {
Stringnewstr="";
for ( inti = 0 ; i < str.length() ; i++){
charletter = str.charAt(i);
if ( letter >= 'a' && letter <= 'z' || letter >= 'A' && letter <='Z'){
if ( isControl(newstr,letter)) newstr += letter;
}
}
returnnewstr.length() == 26 ? "true" : "false";
}
publicstaticbooleanisControl (Stringstr, charx){
for (inti =0 ; i<str.length(); i++){
if(x==str.charAt(i)) returnfalse;
}
returntrue;
}
publicstaticvoidmain (String[] args) {
// keep this function call here
Scanners = newScanner(System.in);
System.out.print(StringChallenge(s.nextLine()));
}
}