4 ms·
And what do you do with odd grid sizes? Honestly the whole second half seemed damned weird. Give the requirement to zero the edges of a two dimensional array,
by wang_li 10y ago
And what do you do with odd grid sizes?
Honestly the whole second half seemed damned weird. Give the requirement to zero the edges of a two dimensional array, it's so astonishingly obvious to just hard code the 0 and width-1/height-1 that do do anything else suggests a special effort to make a sub-optimal solution simply for arguments sake.