const solve = chips => { const [low, mid, high] = [...chips].sort() const extra = low & 1 const rings = low - extra const tower = mid - rings const last = (high !== mid) & extra return rings * 3 + tower + last }
We're a place where coders share, stay up-to-date and grow their careers.
"constant time" in Javascript