Company: MediaNet_8oct
Difficulty: medium
Damaged Roads Problem Description You are the Prime Minister of a country and once you went for a world tour. After 5 years, when you returned to your country, you were shocked to see the condition of the roads between the cities. So, you plan to repair them, but you cannot afford to spend a lot of money. The country can be represented as a N x M grid, where Country[i][j] is a city. The cost of repairing a road between (i,j) and (i+1,j) is A[i]. The cost of repairing a road between (i,j) and (i,j+1) is B[j]. Return the minimum cost of repairing the roads. As the cost can be large, return the cost modulo 10 9 +7. Input Format: The first argument will be an integer array, A, of size N. The second argument will be an integer array, B, of size M. Output Format: Return an integer representing the minimum possible cost. Examples Example 1: Input: A = [1, 1, 1] B = [1, 1, 2] Output: 16 Example 2: Input: A = [1, 2, 3] B = [4, 5, 6] Output: 39 Constraints 1 <= N, M <= 1e5 1 <= A[i], B[