Hoarding programming problems for you!

Looking for good programming challenges?

Use the search below to find our solutions for selected questions!

All posts tagged permutation

Next permutation challenge

Problem statement Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possible, it must rearrange it as the lowest possible order (ie, sorted in ascending order). The replacement must be in-place, do not allocate extra memory. Here are some examples. . . . Read more

Finding n-th permutation without computing others

Given S of size n and k, return the kth lexicographic permutation sequence. (Note: Given n will be between 1 and 10 inclusive.) For n = 10 variable symbols we have 10! possible permutations. The first step is to find the first symbol. If we fix a first symbol, then . . . Read more