Getting SIGSEGV error in this solution

https://www.codechef.com/viewsolution/58320001
question →
https://www.codechef.com/problems/PERMUT2