I try to see what is wrong with the code but I still have not been able to find an answer, please help
public int moda(int[] a){
int moda=0;
int Rep=0;
for(int i=0;i<a.length-1;i++) {
int cantRep=0;
for(int j=0;j<a.length-1;i++) {
if(a[i]==a[j])
cantRep++;
if(cantRep>Rep) moda=a[i];
Rep=cantRep;
}
}
return moda;
}