I think it would be helpful if you specified whether the vectors are row vectors, column vectors, or whether they can be an arbitrary mixture. The test suite only has row vectors, but this makes it rather trivial.
Hmmm, description is a little confusing. Is length(x) always = length(y)? Are they nx1 or 1xn? Anyhow, I submitted several possible solutions (e.g. z = x'*y, z = sum(x.*y)) all of which failed the test suite ... but they work fine on my machine!
3 Comments