Fizz Buzz || JAVA || Easy || Beats 99%
\n# Code\njava []\nclass Solution {\n    public List<String> fizzBuzz(int n) {\n        List<String>arr=new ArrayList<>(n);\n        for(int i=1;i<=n;i++){\n   
\n# Code\n```java []\nclass Solution {\n    public List<String> fizzBuzz(int n) {\n        List<String>arr=new ArrayList<>(n);\n        for(int i=1;i<=n;i++){\n            if(i%3==0&&i%5==0){\n                arr.add("FizzBuzz");\n            }\n            else if(i%3==0){\n                arr.add("Fizz");\n            }\n            else if(i%5==0){\n                arr.add("Buzz");\n            }\n            else{\n                arr.add(String.valueOf(i));\n            }\n        }\n        return arr;\n    }\n}\n```
['Java']