forked from M3-Academy/challenge-algorithms-v2.0
feat(03): finished
This commit is contained in:
parent
835d645251
commit
82a96126a4
@ -1,4 +1,8 @@
|
||||
export function maxValue(values) {
|
||||
// implementar logica aqui
|
||||
if (values.length == 0) {
|
||||
return 0
|
||||
}
|
||||
return Math.max(...values);
|
||||
|
||||
}
|
@ -1,4 +1,8 @@
|
||||
export function sum(values) {
|
||||
// implementar logica aqui
|
||||
|
||||
let soma = 0
|
||||
for (let index = 0; index < values.lenght; index += 1) {
|
||||
soma = soma + values[index];
|
||||
}
|
||||
return soma;
|
||||
}
|
Loading…
Reference in New Issue
Block a user