-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Solved Assignment #4
base: main
Are you sure you want to change the base?
Conversation
val responses:MutableList<Response> = mutableListOf() | ||
|
||
for (response in data.drop(1)){ | ||
val dataItems = response.split(" ").filter { it!="" } | ||
val student = Response(dataItems[1], dataItems[2].toInt(), dataItems[3], dataItems[4]=="yes") | ||
responses.add(student) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could have used the map
avoiding the use of mutable list.
fun processResponses(responses: List<Response>): List<List<Response>> { | ||
TODO() | ||
return responses.filter {!it.covidPositive}.sortedWith(compareBy({ it.branch }, { it.name })).groupBy { it.branch }.values.chunked(3).map { it.flatten() } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. Approved 🥇
:)