3109: Find the Index of Permutation

Problem Statement