LeetCode 913. Cat and Mouse

minmax problem, usually solution is to use dfs.

For this question, you can record [cat, mouse, turn] recursively, whose turn is based on the decision strategy. However, this problem due to the existence of a draw, but a draw is difficult to judge (the other options are unfavorable, and there is a presence in the recursion stack moves in order to explain the election draw), so dfs top-down search is more difficult to write.

 

 

 

Reference

https://www.youtube.com/watch?v=sq6Ggb98A38

Guess you like

Origin www.cnblogs.com/hankunyan/p/11263287.html