Add the solution without using hash