DEV Community

Discussion on: Days of Code [3]

Collapse
 
seemstechies profile image
Sergey Inozemcev

I understand that you have some predicted conditions but it seems rather expensive to use stack for this sort of problem, because when you put some new value in front of array it is relocate all data in new disk space, much better to use List in this case. Also you can use BigNum object in real production.

Collapse
 
ronaldoperes profile image
Ronaldo Peres

Yes, I understand, but these are the constraints of the challenge.