Online -Compiler zur Zeitkomplexität der Taschenrechnerin
//access modifier flashcard
static int solution(List<Integer> intList) {
PriorityQueue<Integer> pq = new PriorityQueue<>();
for(Integer a:intList){
pq.add(a);
}
int sum = 0;
while(pq.size() > 1){
int curr = pq.poll() + pq.poll();
sum += curr;
pq.add(curr);
}
return sum;
}
Wrong Wren