FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaProgramming/HackerRank/SixtyThree.java at main · Varadraj75/JavaProgramming · GitHub
Varadraj75
/
JavaProgramming
Public
forked from
karterhhgg/JavaProgramming
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaProgramming
/
HackerRank
/
SixtyThree.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
35 lines (29 loc) · 802 Bytes
Breadcrumbs
JavaProgramming
/
HackerRank
/
SixtyThree.java
Copy path
File metadata and controls
35 lines (29 loc) · 802 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
package
HackerRank
;
import
java
.
math
.
BigDecimal
;
import
java
.
util
.*;
class
SixtyThree
{
public
static
void
main
(
String
[]
args
){
//Input
Scanner
sc
=
new
Scanner
(
System
.
in
);
int
n
=
sc
.
nextInt
();
String
[]
s
=
new
String
[
n
+
2
];
for
(
int
i
=
0
;
i
<
n
;
i
++){
s
[
i
]=
sc
.
next
();
}
sc
.
close
();
//Write your code here
Arrays
.
sort
(
s
,
0
,
n
,
new
Comparator
<
String
>() {
public
int
compare
(
String
a
,
String
b
) {
BigDecimal
A
=
new
BigDecimal
(
a
);
BigDecimal
B
=
new
BigDecimal
(
b
);
// Descending order
return
B
.
compareTo
(
A
);
}
});
//Output
for
(
int
i
=
0
;
i
<
n
;
i
++)
{
System
.
out
.
println
(
s
[
i
]);
}
}
}
Back
|
FazBrowse Home
|
New Git URL