Find the number of permutations of n natural numbers such that the indices act as the divisors or multiples.
Eg: n = 4, ans = 8
1234, 2134, 3214, 4231, 3412, 4132, 1432, 2431Asked by: Vamsi_Krishna_Gollapudi on April 7, 2019, 6:34 p.m. Last updated on April 7, 2019, 6:34 p.m.
I see you have already found the solution...
I am posting the link for others to view...
https://leetcode.com/articles/beautiful-arrangement/