In many situations,we need to compute sum of squares of differences taken two at a time.This requires two for loops.. But this particular blog tells you how to reduce the complexity from O(n^2) to O(n).This has implications in Triangles,Polygons,Arbitrary