add min insertion solution.
iteration bug fixed.
prettify code.