# Product of all numbers except self

Given an array ` arr ` of ` n ` integers, print an array ` answer ` such that ` answer[i] ` is equal to product of all elements in ` arr ` except ` arr[i] `.
You should do this problem in ` O(n) ` time complexity and without using ` division `

## Example Test Cases

### Sample Test Case 1

Input Array: ` [2, 3, 4, 5] `
Expected Output: ` [60, 40, 30, 24 ] `
Explanation: ` answer = arr*arr*arr `, ` answer = arr*arr*arr ` and ` answer = arr*arr*arr ` and ` answer = arr * arr * arr `

## Solution

To solve this problem, let us define two arrays ` left ` and ` right ` of size ` n `, such that
` left[i] = arr*arr*arr...arr[i-1] ` and
` right[i] = arr[i + 1]*arr[i + 2]*arr[i + 3]*arr[i + 4]*....arr[n-1]`
We want to compute ` answer[i] ` for each value of ` i `
We know that ` answer[i] = (arr*arr*arr*...arr[i-1])*(arr[i+1]*arr[i + 2]*arr[i + 3]*arr[i + 4]....arr[n-1]) `

Therefore, using the above three equations we can rewrite ` answer[i] ` as ` answer[i] = left[i] * right[i] ` Therefore, we can compute arrays ` left ` and ` right ` in one loop and then compute the array ` answer ` as shown below.

## Solution Implementation

```#include <iostream>
#include <vector>
using namespace std;

vector<int> getProduct(vector<int>& arr) {
int n = arr.size();
left = 1; right[n - 1] = 1;
for(int i = 1; i < n; i++) {
left[i] = left[i-1]*arr[i-1];
right[n - i - 1] = right[n-i]*arr[n - i];
}
for(int i = 0; i < n; i++) {
}