Can't get simpler (C++)


#1

vector Solution::fizzBuzz(int A) {
vector s;
for(int i = 1; i <= A; i++)
{
if(i>=5 && i%3 == 0 && i%5 ==0) s.push_back(“FizzBuzz”);
else if(i>=3 && i%3 == 0)s.push_back(“Fizz”);
else if(i>=5 && i%5 == 0)s.push_back(“Buzz”);
else {
string A = to_string(i);
s.push_back(A);
A.clear();
}
}
return s;
}