SHARE
TWEET

gg

Babul_420 May 31st, 2020 (edited) 954 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. for(int i=1;i<=n;i++){
  2.     for(int j=0;j<=w;j++){
  3.         if(j==0 ) totalway[i][j]=1;
  4.         else if(coins[i]>j) totalway[i][j]= totalway[i-1][j];
  5.         else totalway[i][j]= totalway[i-1][j]+ totalway[i][j-coins[i]];
  6.     }
  7.   }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top