File tree Expand file tree Collapse file tree
exercises/series/src/example/java Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44import java .util .List ;
55import java .util .stream .Collectors ;
66
7- public class Series {
7+ class Series {
88
99 private final int digitsSize ;
1010 private List <Integer > digits ;
1111
12- public Series (String string ) {
13- this .digits = Arrays
14- .asList (string .split (("" )))
15- .stream ()
16- .map (digit -> Integer .parseInt (digit ))
17- .collect (Collectors .toList ());
12+ Series (String string ) {
13+ this .digits = Arrays .stream (string .split ("" ))
14+ .map (Integer ::parseInt )
15+ .collect (Collectors .toList ());
1816 this .digitsSize = this .digits .size ();
1917 }
2018
21- public List <List <Integer >> slices (int num ) {
19+ List <List <Integer >> slices (int num ) {
2220 if (num > this .digitsSize ) {
2321 throw new IllegalArgumentException ("Slice size is too big." );
2422 }
@@ -32,7 +30,7 @@ public List<List<Integer>> slices(int num) {
3230 return result ;
3331 }
3432
35- public List <Integer > getDigits () {
33+ List <Integer > getDigits () {
3634 return digits ;
3735 }
3836
You can’t perform that action at this time.
0 commit comments