Sudoku algorithm in C#

前端 未结 9 964
南方客
南方客 2021-02-03 15:24

I need one liner (or close to it) that verifies that given array of 9 elements doesn\'t contain repeating numbers 1,2,3,...,9. Repeating zeroes do not count (they represent empt

9条回答
  •  孤街浪徒
    2021-02-03 16:09

    The following is simple and fast.

    if a.Select(i => Math.Pow(2, i - 1)).ToArray().Sum()==511 ...
    

提交回复
热议问题