Solving the N x N number slider