3 ms·
You wouldn't, because you can't be sure you've found the last value satisfying the predicate until you reach the end of the list. To do it lazily, you'd have to
by throwanem 11y ago
You wouldn't, because you can't be sure you've found the last value satisfying the predicate until you reach the end of the list. To do it lazily, you'd have to reverse the list first, but that's O(n), so not practical with very long lists.