• + 0 comments

    would it improve the performance if we replace the last part with

    Iterator<Integer> iter = list.iterator();
    while(list.size() > k) {
    	totalLuck -= 2*iter.next();
    	k++;
    }
    return totalLuck;
    

    ?