diff --git a/README.md b/README.md index e69de29..58cea6f 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,25 @@ +#Run-Length-Encoding + +##Goal +Starting with a digit, count how often this digit occurs in succession. +Then repeat the the procedure for given number of `iterations`. +In human terms this is like speaking out loud how often each digit appears consecutively. + +###Input +`iterations` - a numeric value how often the process is repeated + +###Output +A numeric value representing a stream of occurrences and digits. + +###Constraints +1 <= `iterations` <= 10 +**Start value** = 0 + +###Examples +Assuming the start value is `1` and `iteration` is 5: +0\. iteration: `0` (reading: *one 1*) +1\. iteration: `10` (reading: *two 1s*) +2\. iteration: `1110` (reading: *one 2 and one 1*) +3\. iteration: `3110` (reading: *one 1 and one two and two 1s*) +4\. iteration: `132110` (reading: *three 1s and two 2s and one 1*) +5\. iteration: `1113122110` diff --git a/src/main/java/Solution.java b/src/main/java/Solution.java index 0ac702e..5615be4 100644 --- a/src/main/java/Solution.java +++ b/src/main/java/Solution.java @@ -8,7 +8,7 @@ import java.math.*; **/ class Solution { - public static void main( String args[] ) { + public static void main( String[] args ) { Scanner in = new Scanner( System.in ); // read values with in.next...() methods diff --git a/src/test/resources/testdata.csv b/src/test/resources/testdata.csv index e69de29..acdca74 100644 --- a/src/test/resources/testdata.csv +++ b/src/test/resources/testdata.csv @@ -0,0 +1,7 @@ +0, 1 +1, 11 +2, 21 +3, 1211 +4, 111221 +5, 312211 +8, 31131211131221