Please ignore secret bonuses. Secret tests do NOT award bonus. Max hw grade is 30+2 bonus efficiency

Do you need help?

Homework8 timeout test 7 and 8

a
angelaob (1190 points)
2 4 7
in HW8 by (1.2k points)
Guys, does anyone have any tips on how to avoid timeout on tests 7 and 8 when doing Homework8? I don't make all possible combinations of matrices at once, I use rules to allow combinations for rows and then for whole matrices, but still it takes quite a bit of time to finish these two tests.
258 views

2 Answers

gabriel.bustamante (2540 points)
3 6 20
by (2.5k points)
If you aren't generating invalid images/nodes, then you may be calling other functions or methods more than needed. I realized that by profiling my code and it was simply a matter of storing the adjacent colors (which couldn't be picked for the next pixel) in a variable, instead of finding them for each child node
Nilats (3750 points)
8 14 29
by (3.8k points)
I think you did a lot of IF statements while checking for every combination of pixels between 2 rows without actually saving it.