You are viewing a single comment's thread. Return to all comments →
Here are 3 things you may want to know if you are stuck:
-If n is an even number (n%k == 0) lets you know if there is a valid permutation or you should just print -1
-If k=0 just print 1... n
-If n is an odd number and it also is greater than 0, print -1
Seems like cookies are disabled on this browser, please enable them to open this website
Absolute Permutation
You are viewing a single comment's thread. Return to all comments →
Here are 3 things you may want to know if you are stuck:
-If n is an even number (n%k == 0) lets you know if there is a valid permutation or you should just print -1
-If k=0 just print 1... n
-If n is an odd number and it also is greater than 0, print -1