Problem no 75: returning sum of left diagonal elements in 2d array and max of 1d array in Arraylist.
problem: Given a integer n . We have n*n values of a 2-d array, and n values of 1-d array. Task is to find the sum of the left diagonal values of the 2-d array and the max element of the 1-d array and print them with space in between. Example 1: ​Input : arr[][] = {{1,2,3}, {4,5,6}, {7, 8,9}} and N = 3 brr[] = {3, 6, 9} Output : 15 9 Explanation: 1 2 3 4 5 6 7 8 9 So, this sum of left diagonal (1+ 5 + 9) = 15 The maximum element in an array brr is 9 So, will return {15, 9} as an answer. ​Example 2: Input : arr[][] = {{1,2}, {1, 2}} and N = 2 brr[] = {10, 1} Output : 3 10 Your Task: This is a function problem. The input is already taken care of by the driver code. You only need to complete the function array() that takes a two-dimension array (a) , another one dimension array (b), sizeOfArray (n) , and return the ArrayList which is having the sum of the diagonal element...