Inverse a number

Take the following as input.
A number
Assume that for a number of n digits, the value of each digit is from 1 to n and is unique. E.g. 32145 is a valid input number.

Write a function that returns its inverse, where inverse is defined as follows

Inverse of 32145 is 12543. In 32145, “5” is at 1st place, therefore in 12543, “1” is at 5th place; in 32145, “4” is at 2nd place, therefore in 12543, “2” is at 4th place.


i am not able to understand the question and also the logic which is present on hackerblock

public static int inverse(int num){

    int place = 1;
    int mult = 1;
    int ans = 0;

    while(num != 0){
        int rem = num % 10;
        ans = ans + place * (int)Math.pow(10, rem - 1);
        num = num / 10;
        place++;
    }

    return ans;
}

Here is my code. Please see if this makes any sense. Any improvents are welcomed.
Scanner sc = new Scanner(System.in);
System.out.println(“Enter any number”);
int num = sc.nextInt();

                int [] array = new int[10];
                int count =1;
                while(num>0){
                    array[num%10]=count;
                    count++;
                    num/=10;
                }
                for(int i= array.length-1;i>0;i--){
                    if(array[i]!=0){
                        System.out.print(" "+array[i]);
                    }
                }