Least memory comsumption commit for large Input

The run time increases considerably. Not a good alternative.