Write the function sqsum of type int list int that takes a
Write the function sqsum of type int list -> int that takes a list of integers and returns the sum of the squares of those integers. For example, if you evaluate sqsum [1,2,3,4] you should get 1^2 + 2^2 + 3^2 + 4^2 = 30.
Solution
Returns the sum of all \'sub\' squares. E.g. sqsum 3 = 1*1 + 2*2 + 3*3
fun sqsum(x:int) =
if x = 0 then 0
else x*x + sqsum(x-1)
