solve the state space search tree bruteforce at leave node