Question: In a functional language, using the map and reduce higher order functions, write code that will compute the following. ( Do not use more complex

In a functional language, using the map and reduce higher order functions, write code that will compute the following. (Do not use more complex built-in functions like sum and filter, but if statements are okay.)a) The sum of all positive numbers in integer array xs (1 Point)b) The sum of squared differences between integer array xs and ys.[You can use zip to combine xs and ys element-wise.](1 Point)Example:1234 let xs =[3,4,5,10,15] let ys =[0,4,6,11,17] Part a =30Part b =15

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!