Skip to content

Commit

Permalink
updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
RodneyShag committed Feb 9, 2017
1 parent 354f4d9 commit 0670409
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
22 changes: 8 additions & 14 deletions Java/Strings/Java Regex/Solution.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.Scanner;

class Solution{

public static void main(String []args){
Scanner in = new Scanner(System.in);
while(in.hasNext()){
String IP = in.next();
System.out.println(IP.matches(new MyRegex().pattern));
}

}
/*
[01]?\\d{1,2} matches numbers 0-199.
2[0-4]\\d matches numbers 200-249
25[0-5] matches numbers 250-255
*/
class MyRegex {
String num = "([01]?\\d{1,2}|2[0-4]\\d|25[0-5])";
String pattern = num + "." + num + "." + num + "." + num;
}
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ My Java solutions to [HackerRank](https://www.hackerrank.com/) challenges
| Java | Strings | [Java String Compare](https://www.hackerrank.com/challenges/java-string-compare) | Easy | [Solution.java](https://github.com/rshaghoulian/HackerRank-solutions/blob/master/Java/Strings/Java%20String%20Compare/Solution.java) |
| Java | Strings | [Java String Reverse](https://www.hackerrank.com/challenges/java-string-reverse) | Easy | [Solution.java](https://github.com/rshaghoulian/HackerRank-solutions/blob/master/Java/Strings/Java%20String%20Reverse/Solution.java) |
| Java | Strings | [Java Anagrams](https://www.hackerrank.com/challenges/java-anagrams) | Easy | [Solution.java](https://github.com/rshaghoulian/HackerRank-solutions/blob/master/Java/Strings/Java%20Anagrams/Solution.java) |
| Java | Strings | [Java String Tokens](https://www.hackerrank.com/challenges/java-string-tokens) | Easy | [Solution.java](https://github.com/rshaghoulian/HackerRank-solutions/blob/master/Java/Strings/Java%20String%20Tokens/Solution.java) |
| Java | Strings | [Pattern Syntax Checker](https://www.hackerrank.com/challenges/pattern-syntax-checker) | Easy | [Solution.java](https://github.com/rshaghoulian/HackerRank-solutions/blob/master/Java/Strings/Pattern%20Syntax%20Checker/Solution.java) |
| Java | Strings | [Java Regex](https://www.hackerrank.com/challenges/java-regex) | Medium | [Solution.java](https://github.com/rshaghoulian/HackerRank-solutions/blob/master/Java/Strings/Java%20Regex/Solution.java) |
| Java | Strings | [Java Regex 2 - Duplicate Words](https://www.hackerrank.com/challenges/duplicate-word) | Easy | [Solution.java](https://github.com/rshaghoulian/HackerRank-solutions/blob/master/Java/Strings/Java%20Regex%202%20-%20Duplicate%20Words/Solution.java) |


## Tutorials - 30 Days of Code
Expand All @@ -35,6 +39,9 @@ My Java solutions to [HackerRank](https://www.hackerrank.com/) challenges
| Tutorials | 30 Days of Code | 2 | [Operators](https://www.hackerrank.com/challenges/30-operators) | Easy | [Solution.java](https://github.com/rshaghoulian/HackerRank-solutions/blob/master/Tutorials/30%20Days%20of%20Code/Day%202%20-%20Operators/Solution.java) |
| Tutorials | 30 Days of Code | 3 | [Intro to Conditional Statements](https://www.hackerrank.com/challenges/30-conditional-statements) | Easy | [Solution.java](https://github.com/rshaghoulian/HackerRank-solutions/blob/master/Tutorials/30%20Days%20of%20Code/Day%203%20-%20Intro%20to%20Conditional%20Statements/Solution.java) |
| Tutorials | 30 Days of Code | 4 | [Class vs. Instance](https://www.hackerrank.com/challenges/30-class-vs-instance) | Easy | [Solution.java](https://github.com/rshaghoulian/HackerRank-solutions/blob/master/Tutorials/30%20Days%20of%20Code/Day%204%20-%20Class%20vs.%20Instance/Solution.java) |
| Tutorials | 30 Days of Code | 5 | [Loops](https://www.hackerrank.com/challenges/30-loops) | Easy | [Solution.java](https://github.com/rshaghoulian/HackerRank-solutions/blob/master/Tutorials/30%20Days%20of%20Code/Day%205%20-%20Loops/Solution.java) |
| Tutorials | 30 Days of Code | 6 | [Let's Review](https://www.hackerrank.com/challenges/30-review-loop) | Easy | [Solution.java](https://github.com/rshaghoulian/HackerRank-solutions/blob/master/Tutorials/30%20Days%20of%20Code/Day%206%20-%20Let's%20Review/Solution.java) |
| Tutorials | 30 Days of Code | 7 | [Arrays](https://www.hackerrank.com/challenges/30-arrays) | Easy | [Solution.java](https://github.com/rshaghoulian/HackerRank-solutions/blob/master/Tutorials/30%20Days%20of%20Code/Day%207%20-%20Arrays/Solution.java) |


## Tutorials - Cracking the Coding Interview
Expand All @@ -55,6 +62,12 @@ My Java solutions to [HackerRank](https://www.hackerrank.com/) challenges
| Tutorials | Cracking the Coding Interview | Algorithms | [Merge Sort: Counting Inversions](https://www.hackerrank.com/challenges/ctci-merge-sort) | Hard | [Solution.java](https://github.com/rshaghoulian/HackerRank-solutions/blob/master/Tutorials/Cracking%20the%20Coding%20Interview/Algorithms/Merge%20Sort%20-%20Counting%20Inversions/Solution.java) |
| Tutorials | Cracking the Coding Interview | Algorithms | [Binary Search: Ice Cream Parlor](https://www.hackerrank.com/challenges/ctci-ice-cream-parlor) | Medium | [Solution.java](https://github.com/rshaghoulian/HackerRank-solutions/blob/master/Tutorials/Cracking%20the%20Coding%20Interview/Algorithms/Binary%20Search%20-%20Ice%20Cream%20Parlor/Solution.java) |
| Tutorials | Cracking the Coding Interview | Algorithms | [DFS: Connected Cell in a Grid](https://www.hackerrank.com/challenges/ctci-connected-cell-in-a-grid) | Hard | [Solution.java](https://github.com/rshaghoulian/HackerRank-solutions/blob/master/Tutorials/Cracking%20the%20Coding%20Interview/Algorithms/DFS%20-%20Connected%20Cell%20in%20a%20Grid/Solution.java) |
| Tutorials | Cracking the Coding Interview | Algorithms | [BFS: Shortest Reach in a Graph](https://www.hackerrank.com/challenges/ctci-bfs-shortest-reach) | Hard | [Solution.java](https://github.com/rshaghoulian/HackerRank-solutions/blob/master/Tutorials/Cracking%20the%20Coding%20Interview/Algorithms/BFS%20-%20Shortest%20Reach%20in%20a%20Graph/Solution.java) |
| Tutorials | Cracking the Coding Interview | Techniques / Concepts | [Time Complexity: Primality](https://www.hackerrank.com/challenges/ctci-big-o) | Medium | [Solution.java](https://github.com/rshaghoulian/HackerRank-solutions/blob/master/Tutorials/Cracking%20the%20Coding%20Interview/Techniques%2C%20Concepts/Time%20Complexity%20-%20Primality/Solution.java) |
| Tutorials | Cracking the Coding Interview | Techniques / Concepts | [Recrusion: Fibonacci Numbers](https://www.hackerrank.com/challenges/ctci-fibonacci-numbers) | Easy | [Solution.java](https://github.com/rshaghoulian/HackerRank-solutions/blob/master/Tutorials/Cracking%20the%20Coding%20Interview/Techniques%2C%20Concepts/Recursion%20-%20Fibonacci%20Numbers/Solution.java) |
| Tutorials | Cracking the Coding Interview | Techniques / Concepts | [Recursion: Davis' Staircase](https://www.hackerrank.com/challenges/ctci-recursive-staircase) | Medium | [Solution.java](https://github.com/rshaghoulian/HackerRank-solutions/blob/master/Tutorials/Cracking%20the%20Coding%20Interview/Techniques%2C%20Concepts/Recursion%20-%20Davis'%20Staircase/Solution.java) |
| Tutorials | Cracking the Coding Interview | Techniques / Concepts | [DP: Coin Change](https://www.hackerrank.com/challenges/ctci-coin-change) | Hard | [Solution.java](https://github.com/rshaghoulian/HackerRank-solutions/blob/master/Tutorials/Cracking%20the%20Coding%20Interview/Techniques%2C%20Concepts/DP%20-%20Coin%20Change/Solution.java) |
| Tutorials | Cracking the Coding Interview | Techniques / Concepts | [Bit Manipulation: Lonely Integer](https://www.hackerrank.com/challenges/ctci-lonely-integer) | Easy | [Solution.java](https://github.com/rshaghoulian/HackerRank-solutions/blob/master/Tutorials/Cracking%20the%20Coding%20Interview/Techniques%2C%20Concepts/Bit%20Manipulation%20-%20Lonely%20Integer/Solution.java) |


## Tutorials - 10 Days of Statistics
Expand All @@ -65,6 +78,7 @@ My Java solutions to [HackerRank](https://www.hackerrank.com/) challenges
| Tutorials | 10 Days of Statistics | 0 | [Weighted Mean](https://www.hackerrank.com/challenges/s10-weighted-mean) | Easy | [Solution.java](https://github.com/rshaghoulian/HackerRank-solutions/blob/master/Tutorials/10%20Days%20of%20Statistics/Day%200%20-%20Weighted%20Mean/Solution.java) |
| Tutorials | 10 Days of Statistics | 1 | [Quartiles](https://www.hackerrank.com/challenges/s10-quartiles) | Easy | [Solution.java](https://github.com/rshaghoulian/HackerRank-solutions/blob/master/Tutorials/10%20Days%20of%20Statistics/Day%201%20-%20Quartiles/Solution.java) |
| Tutorials | 10 Days of Statistics | 1 | [Interquartile Range](https://www.hackerrank.com/challenges/s10-interquartile-range) | Easy | [Solution.java](https://github.com/rshaghoulian/HackerRank-solutions/blob/master/Tutorials/10%20Days%20of%20Statistics/Day%201%20-%20Interquartile%20Range/Solution.java) |
| Tutorials | 10 Days of Statistics | 1 | [Standard Deviation](https://www.hackerrank.com/challenges/s10-standard-deviation) | Easy | [Solution.java](https://github.com/rshaghoulian/HackerRank-solutions/blob/master/Tutorials/10%20Days%20of%20Statistics/Day%201%20-%20Standard%20Deviation/Solution.java) |


## Algorithms
Expand Down

0 comments on commit 0670409

Please sign in to comment.