Frage im Vorstellungsgespräch bei Bounteous x Accolite

Given an arraylist Find the first largest and second largest from the arraylist. Store both value in different variable.

Antwort im Vorstellungsgespräch

Anonym

26. Apr. 2025

You can use stream and sort in reverseOrder. for the second largest you just skip one element and than do findfirst second Largest -> lis.streams().sorted((a,b)->b-a).skip(1).findFirst();