Problem 44756. Lights Out 5 - 5x5, 10 moves
Lights Out is a logic game wherein all lights need to be turned off to complete each board. See the first problem in the series for an introduction.
This problem contains boards that each require ten moves to solve. For example, if
board = [0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1]
an answer is:
moves = [1 2 3 4 5 16 17 18 19 20]
Prev.: 5x5, 8 moves — Next: 5x5, 13 moves
Solution Stats
Problem Comments
-
8 Comments
@goc3
A piece of advice, measure the running time(using tic, toc, for example) in the test suit to see which solution is fast.
@li haitao: I got 3.838179s (total time for test suite) for William's solution and 0.986936s (1/4 the time) for your sped-up version. Impressive.
i am surprised about the fact that some test admit a shorter solution than 10 moves :S
Solution Comments
Show commentsProblem Recent Solvers15
Suggested Problems
-
Project Euler: Problem 8, Find largest product in a large string of numbers
1198 Solvers
-
1122 Solvers
-
324 Solvers
-
Basics: 'Find the eigenvalues of given matrix
423 Solvers
-
10031 Solvers
More from this Author139
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!