Created
November 18, 2013 05:54
-
-
Save hhariri/7523145 to your computer and use it in GitHub Desktop.
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 albumAndTrackLowerThanGivenSeconds_v1(durationInSeconds: Int, albums: List<Album>): List<Pair<String, String>> { | |
val list = arrayListOf<Pair<String, String>>() | |
albums.forEach { | |
val album = it.title | |
it.tracks.filter { | |
it.durationInSeconds <= durationInSeconds | |
}.map { | |
list.add(Pair(album, it.title)) | |
} | |
} | |
return list | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment