Excercise 1

Write a function array_map that takes a function and a 2-dimensional array as arguments and returns a new array of of the same shape that has the function applied to each argument.

This problem can be solved in less than 10 lines of code.

Excercise 2

Modify the previous function into the new function array_map_parallel so that it does the calculations in parallel with each calculation on a separate thread. Make sure that your solution will run on all available worker processes.