You are viewing a single comment's thread. Return to all comments →
Wrote a solution like this:
const total = n * m; let newTotal = 0; let support = 0; support = Math.floor(n/2) * Math.floor(m/2); newTotal = total - support * 4; if(newTotal % 2 === 0){ return support + newTotal / 2; }else{ return support + Math.floor(newTotal / 2 )+ 1 }
Then found a solution like this :,)
let x = Math.ceil(n/2) let y = Math.ceil(m/2) return x*y;
Seems like cookies are disabled on this browser, please enable them to open this website
Army Game
You are viewing a single comment's thread. Return to all comments →
Wrote a solution like this:
Then found a solution like this :,)