You are viewing a single comment's thread. Return to all comments →
Why is it not working?? Only Non-Hidden Test Case are working -_-
static int fact(int n) { int fact=1; while(n!=0) { fact=fact*n; n--; } return fact; }
static int perm(int n) { return (int)fact(n)/fact(n-1); } static int connectingTowns(int n, int[] routes) { /* * Write your code here. */ int result=1; for(int i=0;i<routes.length;i++) { int per=perm(routes[i]); //System.out.println(+per); result=result*per; } return result%1234567; }
Seems like cookies are disabled on this browser, please enable them to open this website
Connecting Towns
You are viewing a single comment's thread. Return to all comments →
Why is it not working?? Only Non-Hidden Test Case are working -_-
static int fact(int n) { int fact=1; while(n!=0) { fact=fact*n; n--; } return fact; }