public static void main(String args[]) {
        MthNumberInNSizeArray mn = new MthNumberInNSizeArray();
        int n = 5;
        int m = 120;
        for ( int i = 1; i <= m; i++) {
            int result[] = mn.find(n, i);
            Arrays.stream(result).forEach(r -> System.out.print(r + " "));
            System.out.print("\n");
        }
    }
@author Tushar Roy
Date 01/21/2016

Given a number n, find mth value in permutation of array consisting of [1..n] values.
mth is defined by lexicographical order.
src/com/interview/number/MthNumberInNSizeArray.java