struct CityAndRemainingGas
{
int city=0, remaining_gallons=0;
};
cityRemainingGas = {i, remaining_gas}
Setting member variable inline overrides the default constructor.
error: no match for 'operator=' (operand types are 'FindAmpleCity(const std::vector<int>&, const std::vector<int>&)::CityAndRemainingGas' and '<brace-enclosed initializer list>')
To fix it, you need to remove the int city=0, remaining_gallons=0
to int city, remaining_gallons