Ambiguous Measurements Time : O(high high cups) Space : O(high * high) 123456789101112131415161718192021#include <vector>using namespace std;bool ambiguousMeasurements(vector<vector<int>> measuringCups, int low, int high) { vector<vector<bool>> dp(high + 1, vector<bool>(high + 1)); dp[0][0] = true; for(int i = 0; i <= high; i++) { for(int j = 0; j <= high; j++) { if(!dp[i][j]) continue; for(auto& c : measuringCups) { int nl = i + c[0], nr = j + c[1]; if(low <= nl and nr <= high) return true; if(nl <= high and nr <= high) dp[nl][nr] = true; } } } return false;}