InterviewStreet Triplet optimization
The problem looks like it would have a solution of complexity \$O(n log n)\$. Yours has \$O(n^2)\$. google "number of increasing subsequences". 
The site says input size can be \$10^5\$. A \$O(n^2)\$ algorithm with hash look-ups, hash inserts, and virtual function calls in the inner loop will not finish in a few minutes.
By replacing 

int x=scn.nextInt();


with 

int x = 100000;


and

    arr[i]=scn.nextInt();


with

 arr[i] = i + 1;


you can easily test how your program performs with large input.
A quick order of magnitude analysis: An increasing sequence of ~\$10^5\$ elements will have \$~(10^5)^3\$ increasing subsequences of length 3. Since \$10^3 ~= 2^10\$, \$10^15 ~= 2^50\$. \$2^50\$ >> \$2^31\$. So your triplets variable will overflow. It should be an long.