Problem 54780. Trap a knight
11.76% Correct | 88.24% Incorrect
Last Solution submitted on Aug 13, 2022
Asif Newaz on 13 Aug 2022
my solution (using brute force) is giving the right answer (on the test cases I checked) but it's failing in Cody due to time constraints. I hate it when it does that.
in test case - 5, tic-toc is giving me 5s. I might be able to optimize the code a little more but I am not sure that would be enough. I think it's failing on the loop test cases due to runtime.
is it necessary to use loop cases as they tend to take a long time? why not just random settings?
Solution CommentsShow comments
Problem Recent Solvers2
Create One Large Eye of size N x N Quickly?
More from this Author206
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!