Prototype Design Pattern Gfg Problem