• + 1 comment

    You might want to try replacing List<Long>[] with long[]. There's no reason to build all of those arraylists and aggregate them later.