Skip to content

Instantly share code, notes, and snippets.

@andriybuday
Created February 3, 2020 04:23
Show Gist options
  • Save andriybuday/434658e88ef09dc7e764e1690a56fa53 to your computer and use it in GitHub Desktop.
Save andriybuday/434658e88ef09dc7e764e1690a56fa53 to your computer and use it in GitHub Desktop.
Dynamic Programming
int[] dp = new int[n];
dp[0] = // something that makes sense for initial value
for(int i = 1; i < n; ++i) {
dp[i] = // some way to get value using dp[i-1]
}
return dp[n-1];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment