use iterator movement eliminate using of set. sol of q039