FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaProgramming/HackerRank/TwentyNine.java at patch-2 · subham500071430/JavaProgramming · GitHub
subham500071430
/
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
/
TwentyNine.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
38 lines (28 loc) · 826 Bytes
Breadcrumbs
JavaProgramming
/
HackerRank
/
TwentyNine.java
Copy path
File metadata and controls
38 lines (28 loc) · 826 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
package
HackerRank
;
import
java
.
io
.*;
import
java
.
util
.*;
import
java
.
text
.*;
import
java
.
math
.*;
import
java
.
util
.
regex
.*;
public
class
TwentyNine
{
public
static
void
main
(
String
[]
args
){
Scanner
in
=
new
Scanner
(
System
.
in
);
int
testCases
=
Integer
.
parseInt
(
in
.
nextLine
());
while
(
testCases
>
0
){
String
line
=
in
.
nextLine
();
//Write your code here
boolean
matchFound
=
false
;
Pattern
pattern
=
Pattern
.
compile
(
"<(.+)>([^<]+)</
\\
1>"
);
Matcher
match
=
pattern
.
matcher
(
line
);
while
(
match
.
find
()){
System
.
out
.
println
(
match
.
group
(
2
));
matchFound
=
true
;
}
if
(!
matchFound
){
System
.
out
.
println
(
"None"
);
}
testCases
--;
}
in
.
close
();
}
}
Back
|
FazBrowse Home
|
New Git URL