Created
March 3, 2022 10:37
-
-
Save renanreismartins/804e4efe66e6ce95bdef1457787c3533 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val combinationsLetters = (for { | |
(i, idi) <- List("A", "B", "C", "D", "E").zipWithIndex | |
(j, idj) <- List("A", "B", "C", "D", "E").zipWithIndex.take(idi) | |
(k, _) <- List("A", "B", "C", "D", "E").zipWithIndex.take(idj) | |
} yield (i, j, k)) | |
val combinationsNumbers = (for { | |
(i, idi) <- List("1", "2", "3").zipWithIndex | |
(j, _) <- List("1", "2", "3").zipWithIndex.take(idi) | |
} yield (i, j)) | |
val combinationsAll = (for { | |
i <- combinationsLetters | |
j <- combinationsNumbers | |
} yield (i, j)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment