int uniquePaths(int m, int n){ int* arr=(int*)calloc(n,sizeof(int)); arr[n-1]=1; int i; while(m-->0){ for(i=n-1; i>=0; i--){ arr[i]+=(i+1<n)?arr[i+1] :0; } } return *arr; }