DEV Community

Discussion on: Daily Challenge #275 - Casino Chips

Collapse
 
juanrodriguezarc profile image
Juan Rodríguez
function solve(arr){
    const [a,b,c] = arr.sort((a,b)=> b - a);
    const [x,y] = [a, b+c];
    const z = y > x ? Math.floor((x-y)/2): 0;
    return y + z;
}```