money.cpp: In function 'int main()':
money.cpp:17:33: error: 'z' was not declared in this scope
17 | for(int k = 0;k < j;z++){
| ^
money.cpp:23:51: error: 'dp' was not declared in this scope
23 | if(!flag) memo[i] = min(memo[i], (j ? dp[j - 1] : 0 ) + 1);
| ^~
money.cpp:26:17: error: 'dp' was not declared in this scope
26 | printf("%d",dp[n-1]);
| ^~
money.cpp:7:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
7 | scanf("%d",&n);
| ~~~~~^~~~~~~~~
money.cpp:9:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
9 | scanf("%d",&arr[i]);
| ~~~~~^~~~~~~~~~~~~~