constsolve=(chips)=>{chips.sort((a,b)=>a-b)letdays=0while(days>=0){if(chips[0]>0){days++chips[0]--chips[2]--}elseif(chips[1]>0&&chips[2]>0){days++chips[1]--chips[2]--}else{break;// no chips left! exit the loop}}returndays}
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
My Javascript solution