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.
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.
Yes, I understand, but these are the constraints of the challenge.