+ 3
On every duplicate you create a new instance starting from 0, instead of this you should save the state somewhere, use a Map structure and use the encountered number as index and it's occurrence as value, zerofill the map slot based on whether the number appears now or increment if it reappears.