Modify array to another given array by replacing array elements with the sum of the array | Set-2
Given an Array input consisting only of 1s initially and an array target of size N, the task is to check if the array input can be converted to target by replacing input with the sum of array elements in each step.Examples:Input: input = {…