I implemented a diagonal sudoku.
Diagonals must not have repetitions
My algorithm to check the diagonal was.
- copy diagonals to arrays
left_x
andright_x
for(i) for(j) if(left_x[i]==left_x[j]&&i!=j) return false
for(i) for(j) if(right_x[i]==right_x[j]&&i!=j) return false
Is there a better implementation to this in terms of the running time?