Haskell Write Recursive Function Reachsum Takes Int Target Sum Positive List Positive Int Q37102442

In Haskell:

Write a recursive function reachSum that takes an Int as the targetsum, which will be positive, and
a list of positive Int values. You should return an Int (n) suchthat the sum of the first n elements is
less than or equal to the target, but the sum of the first n+1elements is greater than the target. If the
sum of the list overall is less than the target, return the numberof elements in the list. Basically write up a recursive functionthat add up or less then the target Sum from a list and print outhow many value add up to the

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.