solved 001 with loop
solved 002