Colton Idle
11/30/2021, 3:50 AMephemient
11/30/2021, 3:57 AMlist.sortedBy { it.type == STUDENT }
since false < true
ephemient
11/30/2021, 3:58 AMephemient
11/30/2021, 4:00 AMval (students, others) = list.partition { it.type == STUDENT }
others + students
is more or less your approach but built into stdlibColton Idle
11/30/2021, 4:03 AMColton Idle
11/30/2021, 4:08 AMephemient
11/30/2021, 4:08 AMephemient
11/30/2021, 4:10 AMColton Idle
11/30/2021, 4:12 AMephemient
11/30/2021, 4:12 AMColton Idle
11/30/2021, 4:13 AMephemient
11/30/2021, 4:14 AMursus
11/30/2021, 8:40 PM