Solution for Dot Product

I hope the solution isn't considered too complex?