Question: In python Problem Statement AA You are given an array Arr of size N. You need to perform exactly K operations on the array. In

In python Problem Statement AA You are given an array Arr ofsize N. You need to perform exactly K operations on the array.In one operation the following tasks reeds to be done Choose anelement Arr[i] If Arr[i] is 0 it remains 0 otherwise subtract oneIn python

Problem Statement AA You are given an array Arr of size N. You need to perform exactly K operations on the array. In one operation the following tasks reeds to be done Choose an element Arr[i] If Arr[i] is 0 it remains 0 otherwise subtract one from this element hence after this operation Arr[i]=Arri)-1. Assume that you perform operations optimally. Your task is to find the maximum possible value of multiplication of array elements after performing exactly K operations. Since the answer can be very large return it modulo 10^9+7 Input Format The first line contains an integer, N, denoting the number of elements The next line contains an integer, K, denoting the number of operations. Each line i of the N subsequent lines (where 0 Si0->0. Hence the final array after operations is 1000 and multiplication is We need to 0. 8 2 3 We need to perform 3 operations on the array. Perform the first operation on 3 and the other two operations on 4. [4,2,3,1]->[4.2.2,11- >[3,2,2,11-> 12,2,2,1). Hence the produet is 222ES 1.1.3.11 111211. Hence de multiplieation is Languages Python a Python, Cibalore, Flam

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 Databases Questions!