@admin, please consider defining the Employee class as this:
data class Employee(val id: Int, val importance: Int, val subordinates: List<Int> = listOf())Reasons are:
data keyword helps with destructuring later on, than bare/regular classes.Also for the method signature, I think List<Employee> should be enough, no need in List<Employee?>, which is unnecessarily open in my opinion.
Thanks.