For this Question: Find the smallest number which has exactly P divisors.


Note:- It is guaranteed that the number to found is less than 1000.<b>User task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the functions <b>MinimumNumber()</b> that takes the integer P as a parameter.

</b>Constraints:</b>
1 <= P <= 32

<b>Note:</b> 
<i>But there is a catch here given user function has already code in it which may or may not be correct, now you need to figure out these and correct if it is required</i>Return the smallest number which has exactly P divisors.Sample Input:-
4

Sample Output:-
6

Sample Input:-
1

Sample Output:-
1, I have written this Solution Code: static int solve(int n){
int cnt=0;
for(int i=1;i<=n;i++){
if(n%i==0){cnt++;}
}
return cnt;
}

static int MinimumNumber(int P){
int i=1;

for( i=1; i<=1000 && solve(i)!=P;i++){
}
return i;
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?