group_positive: Function that sums the positive numbers within an array.

Description Arguments Details Value Examples

Description

It takes an array as input and it spills out the array with the positive integers summed

Arguments

v

an array of length n>0

Details

The time complexity of this function is linear

Value

res

the new array

Examples

1
group_positive_r(c(5, -5, 3, -5, 10, 10, -8, 9, -5))

maxime970/Algo documentation built on Jan. 26, 2021, 1:31 a.m.