euclidean distance


See On Github

Data

Contributor

Generic placeholder thumbnail

by jcla1

in scala

Source Code

def euclideanDistance(p: List[Int], q: List[Int]): Int =
    math.sqrt(p.zip(q).map { case (u, v) => math.pow(u-v, 2) }.sum)