Cody

# Problem 556. Stuff the Board

Solution 3676373

Submitted on 16 Nov 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Fail
tiles = [7 12 8 6 9]; nRows = 2; nCols = 2; omit = 6; board = fill_board(tiles,nRows,nCols); tiles_used = tiles(board(:)); assert(isequal(setdiff(tiles,tiles_used),omit))

Matrix dimensions must agree. Error in fill_board (line 4) find(tiles~=o(size(tiles,2)-n+1:size(tiles,2))) Error in Test1 (line 6) board = fill_board(tiles,nRows,nCols);

2   Fail
tiles = [12 6 1 20 18 7 4 17]; nRows = 3; nCols = 2; omit = [1 4]; board = fill_board(tiles,nRows,nCols); tiles_used = tiles(board(:)); assert(isequal(setdiff(tiles,tiles_used),omit))

Matrix dimensions must agree. Error in fill_board (line 4) find(tiles~=o(size(tiles,2)-n+1:size(tiles,2))) Error in Test2 (line 6) board = fill_board(tiles,nRows,nCols);

3   Fail
tiles = [2 10 25 38 39 5 24 14 4]; nRows = 2; nCols = 3; omit = [2 4 5]; board = fill_board(tiles,nRows,nCols); tiles_used = tiles(board(:)); assert(isequal(setdiff(tiles,tiles_used),omit))

Matrix dimensions must agree. Error in fill_board (line 4) find(tiles~=o(size(tiles,2)-n+1:size(tiles,2))) Error in Test3 (line 6) board = fill_board(tiles,nRows,nCols);

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!