dynamic programming

1 min read

Problem Link: https://www.hackerrank.com/challenges/construct-the-array/problem Solution Giaỉ pháp với dynamic programming: - Giải pháp này bị hạn chế về space complexity O(k*n)...

1 min read

Problem https://www.hackerrank.com/challenges/sherlock-and-cost/problem Solution Use by dynamic programming: long cost(vector<int> B) { map<pair<int,int>, long> v; long v1 = 0; long v2...