Problem 1961. Finding neighbors of [-1:1] in a matrix....

Well I found this one fun to figure out, all you have to do is make a matrix of 1's or 0's (true or false) that show whether or not a number in a matrix is sitting directly next to (a neighbor) that is number that is +1 or -1 or == to that of the original number. Here are some examples: