leetcodeSolution to some Leetcode problems written in C++ |
git clone git://git.dimitrijedobrota.com/leetcode.git |
Log | Files | Refs | README | LICENSE |
1237.cpp (380B)
0 class Solution { 1 public: 2 vector<vector<int>> findSolution(CustomFunction &customfunction, int z) const { 3 vector<vector<int>> res; 4 for (int x = 1, y = 1000; x <= 1000; ++x) { 5 while (y > 1 && customfunction.f(x, y) > z) 6 y--; 7 if (customfunction.f(x, y) == z) res.push_back({x, y}); 8 } 9 return res; 10 } 11 };