Skip to main content
1 of 2
user64494
  • 29.1k
  • 4
  • 29
  • 56

Certain search in list

A list $LL$ of $n$ real numbers is given. For each element $e$ of $LL$ to find the position of the closest to the right element of $LL$ which is at least twice bigger than $e$ and return it. If such element does not exist, then {} should be returned.

How to program that in an optimal way? My search in list-manipulation tagged questions brings nothing and I am not strong in programming so I ask it here.

user64494
  • 29.1k
  • 4
  • 29
  • 56