an array num length n beautiful ifnum permutation integer range 1 nFor 0 j n index k k j 2 numsk numsi numsjGiven integer n return beautiful array num length n there valid answer give n Example 1input n 4Output 2143example 2input n 5Output 31254 Constraints1 n 1000