C++ optimized solution. All test cases passed.
\nclass Solution {\npublic:\n    vector<string> fizzBuzz(int n) {\n        vector<string> result;\n        \n        for (auto i = 1; i <= n; ++i) {\n          
```\nclass Solution {\npublic:\n    vector<string> fizzBuzz(int n) {\n        vector<string> result;\n        \n        for (auto i = 1; i <= n; ++i) {\n            string str;\n\t\t\t//if (i % 3 == 0 && i % 5 == 0)  <- we don\'t need this. This line is useless\n            //    str+="FizzBuzz"); \n\t\t\t// else\n            if (i % 3 == 0) str += "Fizz";\n            if (i % 5 == 0) str += "Buzz";\n            if (str.empty()) str = to_string(i);\n            \n            result.push_back(str);\n        }\n        \n        return result;\n    }\n};\n```
['C', 'C++']