Counting Triplets

Limits: 12s, 1.0 GB

Given an array of N integers A1, A2, A3 … AN. Vector has to find the number of Fibonacci Triplets in the array meaning how many triplets (i, j, k) are there such that 1 ≤ i < j < k ≤ N and Ai + Aj = Ak.


This is a companion discussion topic for the original entry at https://toph.co/p/counting-triplets