Improving ForkJoin usage for better performance

Using this modification, there is no need to create new int[] lengthArray instances during the ForkJoin recursive operation. It will save you some memory, execution time, and energy consumption.