Check diagonal equality in a matrix | Meta Interview Question