Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.

Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).

Click here to see the full article post

indexes are at both end of the diagonals for example 0,0, and 8,8 adjacent cells on diagonal - for example 0,0 and 1,0 or 2,0 and //1,1 What do the examples mean ?? I don't get it.

the 8,8 in the comment is so confusing, please change it to (2,2)

I think the time cost of calcPatterns() is O(n!), and the time cost for the whole problem is O(n*n!).

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.