Let's consider:List <String> ints = Arrays.asList("1","2","3","4","5","6") and let k=2.
We would like to return following list List<String> : ["12", "23", "34", "45", "56"]
What about elegant solutions? Is it possible to do it with streams ?
Of course it can be solved in many ways, the simplest is iterating over whole list with nested list 1...k.
Any ideas?