Problem statement

https://binarysearch.com/problems/N-Rooks/

Solution

It is jast n!.

Complexity

It is O(1) for time and space for small enough n.

Code

class Solution:
    def solve(self, n):
        return factorial(n)