This approach is particularly useful when we have to consider elements for an operation in an array except a given element.
 
Consider the below example
 
$$
array = \{ 1, 2, 3, 4 \}; \space required = \{ \space p \space | \space p=(\prod_{i \in C}array[i]) \space \{C : indices \space of \space array \space except \space current \space index \} \space \}
$$
The above is basically [LeetCode 238 - Product of Array except self](https://leetcode.com/problems/product-of-array-except-self/description/).
 
To solve the above, the canonical approach would be:
- Consider the `required` array to be in two parts:
$$
required = \{ \space *prefix \space array, \space *suffix \space array \space \}
$$
- Each element of prefix array would represent the product of elements from beginning to just before the element:
$$
prefix \space array = \{ \space x \space | \space x=(\prod_{i=0}^{index(x) - 1} array[i] \space ), \space i \in \mathbb{Z} \space \}
$$
- Each element suffix array would represent the product of elements from end to just after the element:
$$
suffix \space array = \{ \space x \space | \space x=(\prod_{i=index(x) + 1}^{len(array)-1} array[i] \space ), \space i \in \mathbb{Z} \space \}
$$
Therefore, the final required array is:
$$
required = \{\space *\{ \space x \space | \space x=(\prod_{i=0}^{index(x) - 1} array[i] \space ), \space i \in \mathbb{Z} \space \}, \space *\{ \space x \space | \space x=(\prod_{i=index(x) + 1}^{len(array)-1} array[i] \space ), \space i \in \mathbb{Z} \space \}  \space\}
$$
In simple terms, each element of `required` array represents the product of elements of `array` except the current element.