Last active
May 4, 2018 21:00
-
-
Save thomasnield/9c9cf99aaaee824c758f729111fc2d3d to your computer and use it in GitHub Desktop.
test.kt
This file contains hidden or 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
| fun main(args: Array<String>) { | |
| val markets = listOf( | |
| OD("ABQ","PHX"), | |
| OD("DAL", "HOU"), | |
| OD("HOU", "PHX") | |
| ) | |
| val distinctStations = markets.asSequence() | |
| .flatMap { sequenceOf(it.orig, it.dest) } | |
| .distinct() | |
| .toList() | |
| println(distinctStations) | |
| } | |
| data class OD(val orig: String, val dest: String) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment