add a solution without extra space