hacker rank 21th java problem(regex)

21. java regex



//Write your code hereimport java.util.Scanner;
 

class MyRegex {
  private String part = "((25[0-5])|(2[0-4][0-9])|([0-1]{0,1}[0-9]{1,2}))";
  String pattern = String.format("%s\\.%s\\.%s\\.%s", part, part, part, part);
}


Compiler Message
Success
Input (stdin)Download
000.12.12.034
121.234.12.12
23.45.12.56
00.12.123.123123.123
122.23
Hello.IP
Expected OutputDownload
true
true
true
false
false
false

Comments

Popular posts from this blog

Amazon Web Services

Hacker Rank all java and python problem solutions

Google Code-In mentorship experience :)