We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Odd that there are so many upvotes for this comment that is incorrect. When n=6 and k=2 there is still no valid permutation even though it passes the first condition. There are other comments that suggest the right answer, that is (n % 2k == 0).
Cookie support is required to access HackerRank
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 →
Odd that there are so many upvotes for this comment that is incorrect. When n=6 and k=2 there is still no valid permutation even though it passes the first condition. There are other comments that suggest the right answer, that is (n % 2k == 0).