You are viewing a single comment's thread. Return to all comments →
I did something similar.
let height1 = h1.reduce((accum, s) => accum + s, 0); let height2 = h2.reduce((accum, s) => accum + s, 0); let height3 = h3.reduce((accum, s) => accum + s, 0); while (height1 !== height2 || height2 !== height3) { const max = Math.max(height1, height2, height3); if (height1 === max) { height1 -= h1.shift(); } else if (height2 === max) { height2 -= h2.shift(); } else { height3 -= h3.shift(); } } return height1;
Seems like cookies are disabled on this browser, please enable them to open this website
Equal Stacks
You are viewing a single comment's thread. Return to all comments →
I did something similar.