The exercise says \"Make a function with parameters two int arrays and k which is their size. The function should return another array (size k) where every element of it is the
One issue is that you've attempted to declare dynamically sized arrays on the stack (e.g. a[g]). You need to declare pointers for each array and then dynamically allocate your variable sized array once you've read in the value of g.