that is the code with task ``` fun task(st...
# getting-started
g
that is the code with task
Copy code
fun task(start: Int, end: Int) {
            println("Start: $start; End: $end")
            for (i in start until end) distances[i] = Distance(i, euclideanDist(dataSet[i], example))
            latch.countDown()
        }

        for (i in 1..cores) {
            pool.execute { task(startIndex, endIndex) }
            startIndex = endIndex
            endIndex = if (i < cores - 1) endIndex + length else dataSet.size
        }