greatest
finds the max number of digits multiplication
greatestProduct(numbers, digits)
numbers | Digits to iterate over |
---|---|
digits | Max number of digits to compute |
The expected value
This function has the following complexity O($n^2$)
problem8(c(1, 2, 3, 4, 5), 2)#> Error in problem8(c(1, 2, 3, 4, 5), 2): unused argument (2)problem8((1:10), 4)#> Error in problem8((1:10), 4): unused argument (4)problem8((1:100), 13)#> Error in problem8((1:100), 13): unused argument (13)