Cody

# Problem 44761. Lights Out 9 - 5x5, light-only solution? II

Solution 2068527

Submitted on 24 Dec 2019 by Alexander
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   Pass
board = [0 1 0 0 0 1 1 1 0 1 0 1 0 1 1 1 0 0 0 1 1 1 0 0 0]; assert(lights_out_9(board)); % [5 7 23]

2   Pass
board = [1 1 0 0 0 1 0 1 0 0 0 1 1 1 0 0 0 1 0 1 0 0 0 1 1]; assert(lights_out_9(board)); % [1 13 25]

3   Pass
board = [0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 1 1 1 1 0 0 1 0 0]; assert(lights_out_9(board)); % [9 15 19]

4   Pass
board = [0 1 0 1 0 1 1 0 1 1 0 0 0 0 0 1 1 0 1 1 0 1 0 1 0]; assert(lights_out_9(board)); % [7 9 17 19]

5   Pass
board = [1 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1]; assert(lights_out_9(board)); % [1 5 7 9 17 19 21 25]

6   Pass
board = [0 0 1 1 0 0 1 1 1 1 0 1 1 1 1 0 0 1 1 0 0 0 0 0 0]; assert(lights_out_9(board)); % [12 13 17 18]

7   Pass
board = [0 0 1 0 0 0 0 1 0 0 1 1 0 1 1 0 0 1 0 0 0 0 1 0 0]; assert(lights_out_9(board)); % [8 12 14 18]

8   Pass
board = [0 0 0 0 0 1 0 0 0 0 1 0 0 1 0 0 1 1 1 1 0 0 1 0 0]; assert(lights_out_9(board)); % [3 9 15 19]

9   Pass
board = [1 0 1 0 1 1 0 1 0 1 0 0 0 0 0 1 0 1 0 1 1 0 1 0 1]; assert(lights_out_9(board)); % [1 5 11 15 21 25]

10   Pass
board = [0 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 0]; assert(lights_out_9(board)); % [7 8 9 12 14 17 18 19]

11   Pass
board = [0 1 0 0 0 1 0 1 0 0 0 1 0 1 0 0 0 1 0 1 0 0 0 1 0]; assert(lights_out_9(board)); % [2 6 8 12 14 18 20 24]

12   Pass
board = [0 1 1 1 1 1 0 1 0 0 1 1 1 0 0 1 0 1 1 0 0 1 0 0 0]; assert(lights_out_9(board)); % on your own

13   Pass
board = [1 1 1 1 1 1 1 0 1 1 1 0 1 0 1 1 1 0 1 1 1 1 1 1 1]; assert(lights_out_9(board));

14   Pass
board = [0 1 1 1 0 1 0 0 0 1 1 0 1 0 1 1 0 0 0 1 0 1 1 1 0]; assert(lights_out_9(board));

15   Pass
board = [0 0 1 0 0 0 1 1 1 0 1 1 0 1 1 0 1 1 1 0 0 0 1 0 0]; assert(lights_out_9(board));

16   Pass
board = [0 1 0 1 0 1 0 0 0 1 1 1 0 1 1 1 0 0 0 1 0 1 0 1 0]; assert(~lights_out_9(board)); % [7 8 9 17 18 19]

17   Pass
board = [0 1 1 0 0 0 1 0 1 1 1 0 0 0 1 1 1 0 1 0 0 0 1 1 0]; assert(~lights_out_9(board)); % [1 2 5 10 16 21 24 25]

18   Pass
board = [0 0 0 1 0 1 1 0 1 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 0]; assert(~lights_out_9(board)); % [2 5:6 8:11 17:24]

19   Pass
board = [1 0 1 0 0 0 1 1 0 0 1 0 1 0 0 0 1 1 0 0 0 0 0 0 0]; assert(~lights_out_9(board)); % on your own

20   Pass
board = [0 0 0 1 0 1 0 1 0 0 1 1 1 1 0 0 1 1 0 1 0 1 0 1 0]; assert(~lights_out_9(board));

21   Pass
board = [0 0 0 0 0 0 0 1 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 0 0]; assert(lights_out_9(board));

22   Pass
board = [1 0 1 1 0 1 0 0 1 1 0 0 0 0 0 1 1 0 0 1 0 1 1 0 1]; assert(~lights_out_9(board));

### Community Treasure Hunt

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

Start Hunting!