Skip to content

Instantly share code, notes, and snippets.

@xrrocha
Created March 5, 2018 00:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xrrocha/9abae5594fcc7afe588fc50caa4e7529 to your computer and use it in GitHub Desktop.
Save xrrocha/9abae5594fcc7afe588fc50caa4e7529 to your computer and use it in GitHub Desktop.
static Stream<String> transposes(List<WordSplit> splits) {
return splits.stream()
.filter(split -> split.right.length() > 1)
.map(split ->
split.left +
split.right.substring(1, 2) +
split.right.substring(0, 1) +
split.right.substring(2));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment