Created
January 9, 2020 12:42
-
-
Save shubham1710/5afd8f73718382a188a765d84130989d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ll ans = INF; | |
| for(int color = 1; color < N-1; color++){ | |
| for(int ind = 0; ind < dogs[color].size(); ind++){ | |
| if(ind+1 > k) | |
| break; | |
| for(int taken = 0; taken <= k - ind - 1; taken++) | |
| ans = min(ans, dogs[color][ind] + pre[color-1][taken] + suf[color+1][k - taken - ind - 1]); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment