FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
DataStructure-Java/String/IsogramSt.java at master · joharbatta/DataStructure-Java · GitHub
joharbatta
/
DataStructure-Java
Public
Notifications
You must be signed in to change notification settings
Fork
15
Star
9
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
DataStructure-Java
/
String
/
IsogramSt.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
37 lines (29 loc) · 773 Bytes
Breadcrumbs
DataStructure-Java
/
String
/
IsogramSt.java
Copy path
File metadata and controls
37 lines (29 loc) · 773 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
import
java
.
util
.*;
// Given a string S of lowercase aplhabets, check if it is isogram or not.
// An Isogram is a string in which no letter occurs more than once.
public
class
IsogramSt
{
public
static
void
main
(
String
args
[]) {
Scanner
s
=
new
Scanner
(
System
.
in
);
String
str
=
s
.
nextLine
();
isIso
(
str
);
}
static
void
isIso
(
String
str
)
{
str
=
str
.
toLowerCase
();
int
len
=
str
.
length
();
char
arr
[] =
str
.
toCharArray
();
Arrays
.
sort
(
arr
);
for
(
int
i
=
0
;
i
<
len
-
1
;
i
++)
{
if
(
arr
[
i
] ==
arr
[
i
+
1
])
{
System
.
out
.
println
(
"No"
);
break
;
}
else
{
System
.
out
.
println
(
"Yes It is Isogram"
);
}
}
}
}
Back
|
FazBrowse Home
|
New Git URL