Triplet with given sum

Правка en1, от HighHopes, 2019-10-25 20:59:44

Given an array and a value Sum, we need to print any three indices i, j, k such that i != j and j != k and arr[i] + arr[j] + arr[k] = Sum. Can we do it in better than N^2, something like NlogN?

Теги #binary search, #sorting

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский HighHopes 2019-10-25 20:59:44 222 Initial revision (published)