constant additional memory solution to setZeroes