Implement a function squareSum so that it squares any number(s) passed into it and then adds the squares together.
For example, for [1, 2, 2]: it ...
For further actions, you may consider blocking this person and/or reporting abuse
I am in love with Python.
Javascript:
Trying to find a more... unconventional javascript answer :D
Sum of squares is the default example of the Rayon crate:
(this runs in parallel)
Apparently people here are really into onelinerization.
No parallelism, but at least it's shorter than Python.
Btw, you gave "tests" but the tests don't have the supposed results. I know I can hand calculate but still they are not complete test cases.
Point free baby!
(Obviously this is probably too polymorphic, you could just limit it to
[Int] -> Int
)My swift solution :
Elm
I really wish flip is part of the core library...
Python
Elixir
JS:
Kotlin