Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I would add that lambdas as functions don't do anything useful. The only thing you can do with a lambda is to pass it a lambda and it returns a lambda. You have no way to test what the resulting lambda does. You can only pass it another lambda to get another lambda in return. As functions, the set of "lambda functions" behaves exactly like a singleton set containing just the identity function. It is only by considering the input and output of a lambda as expressions that you can differenciate the lambdas.
But for short code like this, the difference is significant. Stack-consuming means writing to and reading from memory. That is slow. The code above runs on 2 registers. Recursivity also means doing calls, which is longer than a conditional jump. A recursive call is much harder for branch prediction and harder to inline.
There must be a typo. An array of 180 plus an array of 240 sums to 420. The sum of your items is 785, not a multiple of 420. And all elements are multiple of 15, except for the 5 which is not. You can not use it in a subarray that sums to 180 or 240.