Row Coloring, 5 Colors — Solution & Editorial
There are k choices for the first cell and (k−1) for each subsequent cell: k·(k−1)N−1.
Complexity: O(log N)
There are k choices for the first cell and (k−1) for each subsequent cell: k·(k−1)N−1.
Complexity: O(log N)