daily pastebin goal
15%
SHARE
TWEET

Untitled

a guest Dec 19th, 2018 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     int combinationSum4(vector<int>& nums, int target) {
  2.         vector<int> memo(target + 1);
  3.         memo[0] = 1;
  4.        
  5.         for (int s = 1; s < memo.size(); ++s) {
  6.             for (auto x : nums) {
  7.                 if (s - x >= 0) memo[s] += memo[s - x];
  8.             }
  9.         }
  10.        
  11.         return memo.back();
  12.     }
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