What is the shortest distance between A and B?

Oh i got this, it’s the diagonal line for sure 
7?
Took me a second to remember how to do that. That's math that I haven't used in a long time.
there is a easy way to remember this kind of problems,like:3 4 5/5 12 13/7 24 25……(or multpy one nunber)
its fun!