for (int i = 0; i < nums.size() - 2; ++i) for (int k = i + 1; k < nums.size() - 1; ++k) for (int v = k + 1; v < nums.size(); ++v) { if (nums[i] + nums[k] + nums[v] != 0) continue; else { int nmax = max(nums[i], nums[k]); nmax = max(nmax, nums[v]); int nmin = min(nums[i], nums[k]); nmin = min(nmin, nums[v]);