Simple solution using JAVA 8 with stream


#1
public class Solution {
    // DO NOT MODIFY THE LIST. IT IS READ ONLY
    public String largestNumber(final List<Integer> A) {
       String ans = A.stream()
                .map(x -> x.toString())
                .sorted((x,y) -> (y+x).compareTo(x+y))
                .reduce("", String::concat);
                
        if(ans.length()>0 && ans.charAt(0)=='0')
            return "0";
        
        return ans;
    }
}

#2

Can you plz explain your answer