Last element of sequence but with a break if a condition is met
Advertisements Let say I have a Sequence<Int> of unknown origin (not necessarily from a collection) and unknown but finite size: val seq = sequenceOf(1, 2, -3, 4, 5, /* … */) Assume the sequence is large enough to make it undesirable to turn the whole sequence into a List. I want to get the last… Read More Last element of sequence but with a break if a condition is met