3 lines solution using lambda functions


#1

vector Solution::fizzBuzz(int A) {
vector out;
for(int i=1; i<=A; i++){
string insert = i%3==0 ? (i%5==0 ? “FizzBuzz” : “Fizz”) : (i%5==0 ? “Buzz” : to_string(i));
out.push_back(insert);
}
return out;
}


#2

Where is the lambda function? I think you meant ternary operator.