Scaling behavior of polyelectrolytes and polyampholytes: Simulation by an ensemble growth method