feat: enable new langs (#42491)

Enable italian and portuguese
This commit is contained in:
Nicholas Carrigan (he/him)
2021-06-15 00:49:18 -07:00
committed by GitHub
parent d8d6d20793
commit f25e3e69f8
3301 changed files with 423168 additions and 6 deletions

View File

@ -0,0 +1,79 @@
---
id: 5a23c84252665b21eecc8042
title: Sum of squares
challengeType: 5
forumTopicId: 302334
dashedName: sum-of-squares
---
# --description--
Write a function to find the sum of squares of an array of integers.
# --hints--
`sumsq` should be a function.
```js
assert(typeof sumsq == 'function');
```
`sumsq([1, 2, 3, 4, 5])` should return a number.
```js
assert(typeof sumsq([1, 2, 3, 4, 5]) == 'number');
```
`sumsq([1, 2, 3, 4, 5])` should return `55`.
```js
assert.equal(sumsq([1, 2, 3, 4, 5]), 55);
```
`sumsq([25, 32, 12, 7, 20])` should return `2242`.
```js
assert.equal(sumsq([25, 32, 12, 7, 20]), 2242);
```
`sumsq([38, 45, 35, 8, 13])` should return `4927`.
```js
assert.equal(sumsq([38, 45, 35, 8, 13]), 4927);
```
`sumsq([43, 36, 20, 34, 24])` should return `5277`.
```js
assert.equal(sumsq([43, 36, 20, 34, 24]), 5277);
```
`sumsq([12, 33, 26, 18, 1, 16, 3])` should return `2499`.
```js
assert.equal(sumsq([12, 33, 26, 18, 1, 16, 3]), 2499);
```
# --seed--
## --seed-contents--
```js
function sumsq(array) {
}
```
# --solutions--
```js
function sumsq(array) {
var sum = 0;
var i, iLen;
for (i = 0, iLen = array.length; i < iLen; i++) {
sum += array[i] * array[i];
}
return sum;
}
```