Python/JS/Go/C++ O( n ) sol. by list comprehension and iteration. [ With explanation ]
Method_#1\nPython O( n ) sol. based on list comprehension\n\n---\n\n\nclass Solution:\n    def fizzBuzz(self, n: int) -> List[str]:\n        \n        # list co
Method_#1\nPython O( n ) sol. based on list comprehension\n\n---\n\n```\nclass Solution:\n    def fizzBuzz(self, n: int) -> List[str]:\n        \n        # list comprehension with string rule of FizzBuzz\n        list_of_output = [ \'Fizz\' * (not i % 3) + \'Buzz\' * (not i % 5 ) or str(i) for i in range(1, n+1) ]\n        \n        return list_of_output\n```\n\n---\n\nMethod_#2\nO( n ) sol. based on iteration. \n\n---\nPython:\n\n```\nclass Solution:\n    def fizzBuzz(self, n: int) -> List[str]:\n        \n        list_of_output = []\n        \n        for i in range(1, n+1):\n            \n            if i % 3 == 0 and i % 5 == 0:\n                # i is multiple of both 3 and 5\n                list_of_output.append(\'FizzBuzz\')\n            \n            elif i % 3 == 0:\n                # i is multiple of 3 only\n                list_of_output.append(\'Fizz\')\n            \n            elif i % 5 == 0:\n                # i is mupltiple of 5 only\n                list_of_output.append(\'Buzz\')\n            \n            else:\n                # i is neither multiple of 3 nor multiple of 5.\n                list_of_output.append( str(i) )\n                \n        \n        return list_of_output\n                \n```\n\n---\n\nJavascript:\n\n```\nvar multipleOf = function( i , k ){\n    return i % k == 0;\n}\n\nvar fizzBuzz = function(n) {\n    \n    let output = [];\n    \n    for( let i = 1 ; i <= n ; i++ ){\n        \n        if( multipleOf(i, 3) && multipleOf(i, 5) ){\n            output.push(\'FizzBuzz\');\n        \n        }else if( multipleOf(i, 3) ){\n            output.push(\'Fizz\');\n        \n        }else if( multipleOf(i, 5) ){\n            output.push(\'Buzz\');\n            \n        }else{\n            output.push( i.toString(10) );\n        }\n    }\n    \n    return output;\n};\n```\n\n---\n\nGo:\n\n```\nfunc multipleOf(i, k int) bool{\n    return i % k == 0;\n}\n\nfunc fizzBuzz(n int) []string {\n\n    result := make( []string, 0);\n    \n    for i := 1 ; i <= n ; i++{\n        \n        if( multipleOf(i, 3) && multipleOf(i, 5) ){\n            result = append(result, "FizzBuzz")\n            \n        }else if( multipleOf(i, 3) ){\n            result = append(result, "Fizz")\n            \n        }else if( multipleOf(i, 5) ){\n            result = append(result, "Buzz")\n            \n        }else{\n            result = append(result, strconv.Itoa(i) )\n            \n        }\n    }\n    \n    return result\n}\n```\n\n---\n\nC++\n\n```\nclass Solution {\npublic:\n    vector<string> fizzBuzz(int n) {\n        \n        vector<string> result;\n        \n        for( int i = 1; i <= n ; i++){\n            \n            if( multipleOf(i, 3) && multipleOf(i, 5) ){\n                result.emplace_back("FizzBuzz");\n                \n            }else if( multipleOf( i, 3) ){\n                result.emplace_back("Fizz");\n                \n            }else if( multipleOf( i, 5) ){\n                result.emplace_back("Buzz");\n                \n            }else{\n                result.emplace_back( std::to_string(i) );\n            }\n        }\n        \n        return result;\n    }\nprivate:\n    bool multipleOf(int i, int k){\n        return i % k == 0;\n    }\n};\n```\n\n---\n\nReference:\n\n[1] [Python official docs about list comprehension](https://docs.python.org/3/tutorial/datastructures.html#list-comprehensions)
['C', 'Iterator', 'Python', 'C++', 'Go', 'JavaScript']