problem : JANE

I think of : I have some state (J,T) and I want to reach (T,J) so I would start from (J,T) and look for each state (J+1,T-1) , (J-1,T-1) ,(J-1,T+1) and (J+1,T+1) and will do BFS and for all valid states of these ones.? but it is O(n^2)