Linas Medžiūnas
Apr 24 · 1 min read

Good point, François! Missed this. So, min/max throw UnsupportedOperationException, while head/last throw NoSuchElementException. Actually, this makes the automatic refactoring by IntelliJ invalid, since it alters the behavior.

Updated my post, thank you.

    Linas Medžiūnas

    Written by

    Software engineer at Wix; unretired competitive programmer; 2x IOI gold medal winner; curious about Quantum algorithms.