include <iostream>using namespace std; int main() { unsigned long int i, x, y, z, counter = 1, a, b, c, ans=0;
} asked 05 Mar '13, 19:23

The 3 nested FOR loops are giving you complexity of n^3.You can eliminate the third loop by using the binary search to find the smallest element greater than arr[x]+arr[y]. link for binary search...its much more than searching an element in the array answered 23 Jun '13, 17:20
