Added sample input.
Getting input, calling LIS method
LIS adds block at every valid heigth and also adds to first position if capacity is greater
Changed index so first block is not added twice.
Capacity for new height stack now checks the current block and chooses the smallest value.
Base is now indexed at 1 instead of i
Updated comment on M array for clarity
added missing braces around if block
Added cleanup section
Added sample input file
Getting input
Train object will hold min and max weights currently on the train.
First two non-equal cars are made into a train.
Make a longer train if this car is lighter than min or heavier than max
The min and max of new train must be more optimal than the existing train of that length. ie - the new min must be greater or the new max must be smaller.
Avoid index out of bounds
Problem says no two input cars wil be the same weight
Updated helper method for efficiency
solvePuzzle now returns the desired value
Added clean up between test cases