Let's say we have two lists, [3;4;5] and [1;2;3], how can I get the distance of 12, which is found by subtracting the second list from the first, and squaring. So (3-1)^2 + (4-2)^2 + (5-3)^2. I currently have this to square it:
List.map (List.map (fun x -> x*x)) [[1; 2]; [2; 3]];;
But how can I get it to subtract and add them all together? The above sequence only returns [[1;4];[4;9]].
Thanks.