I'm trying to just test out this platform. I implemented fizzbuzz in c++:
class Solution {
public:
vector<string> fizzBuzz(int n) {
vector<string> f(n);
for(unsigned a = 1; a <= n; ++a ) {
string s = "";
if(a % 3==0){
s+="Fizz";
}
if(a % 5 ==0){
s+="Buzz";
}
if(a % 3 != 0 && a % 5 !=0){
s+=to_string(a);
}
f[a] = s;
cout << f[a] << endl;
}
return f;
}
};And it works locally but when I run it here I get no output. What am I missing?