Find the longest Subarray with equal Sum and Product
Given an array arr[] of N integers, the task is to find the length of the longest subarray where the sum of the elements in the subarray is equal to the product of the elements in the subarray. Examples: Input: arr[] = [1, 2, 1, 2, 2, 5, 6, 24]Output: 5Explanation: The subarray [1, 2, 1, 2, 2] has a