#algorithm problems with code