Suppose you have n integers labeled from n. A n integers, perm, is considered a beautiful arrangement if for every index i (i n), at least one of the following conditions holds:
perm[i] is divisible by i
i is divisible by perm[i]
Given an integer n, return the total number of beautiful arrangements that can be constructed.
Constraints:
n
Suppose you have n integers labeled from n. A n integers, perm, is considered a beautiful arrangement if for every index i (i n), at least one of the following conditions holds:
perm[i] is divisible by i
i is divisible by perm[i]
Given an integer n, return the total number of beautiful arrangements that can be constructed.
Constraints:
n