What is a proper Scala way to find a last element in the indexed sequence (like Vector, Array or ArrayBuffer) matching a predicate, assuming we want the solution to be fast when the element exists near the sequence end?
One could use seq.reverse.find to achieve this, but that is O(N), as reverse makes a complete copy of the sequence.