Cody

Solution 1993626

Submitted on 28 Oct 2019 by cokakola
  • Size: 37
  • This is the leading solution.
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]

count = 1

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]

count = 2

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]

count = 3

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]

count = 4

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]

count = 5

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]

count = 6

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]

count = 7

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]

count = 8

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]

count = 9

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]

count = 10

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]

count = 11

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

count = 12

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));

count = 13

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));

count = 14

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));

count = 15

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]

count = 16

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]

count = 17

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]

count = 18

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

count = 19

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));

count = 20

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));

count = 21

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));

count = 22