Code now tests for optimal solution instead of default assigning Y to largest floor. Fixed array deletion issue.