Reducing time complexity for finding all possible triplets in an array?
Finding all the triplets is in fact useless. Let $|A| = n$. Observe that each $a \in A$ appears in exactly $\binom{n-1}{2}$ triplets.

Therefore, the requested sum is just:

$$
\sum_{a \in A} \binom{n-1}{2}a = \binom{n-1}{2} \sum_{a \in A} a
$$