red_coder's blog

By red_coder, 12 years ago, In English

hey guys here is a cool problem. u are given an array a[] of integers of size N where each integer is in range [1,100000]. We have to find the number of tuples i<j<k such that L<=a[i]+a[j]+a[k]<=H. Here L and H are integers. Need a solution better than O(N^3).

  • Vote: I like it
  • -1
  • Vote: I do not like it

»
12 years ago, # |
Rev. 2   Vote: I like it +1 Vote: I do not like it