The original code i posted (with all of the arrays) will also work independent on what the test cases are.

Basically, my original code just checks all of different file combinations and keeps track of which pieces were used to create the combinations. And i made sure any file peice would only be used once for a certain combination.

Since there's only once solution possible, i just keep going until I find a combination that used all of the different pieces. That's why that original solution didn't care what the size of the file is - it doesn't really matter.