Leetcode 412. Fizz Buzz
来源:互联网 发布:ntp服务器修改端口 编辑:程序博客网 时间:2024/06/14 19:31
public class Solution { public List<String> fizzBuzz(int n) { List<String> res = new ArrayList<>(); for (int i=1; i<=n ; i++) { if (i%3==0 && i%5==0) { res.add("FizzBuzz"); } else if (i%3 == 0) { res.add("Fizz"); } else if (i%5 == 0){ res.add("Buzz"); } else { res.add(i+""); } } return res; }}
0 0
- LeetCode 412. Fizz Buzz
- [LeetCode]--412. Fizz Buzz
- LeetCode-412. Fizz Buzz
- LeetCode 412. Fizz Buzz
- 【leetcode】412. Fizz Buzz
- LeetCode 412. Fizz Buzz
- leetcode 412. Fizz Buzz
- leetcode 412. Fizz Buzz
- Leetcode 412.Fizz Buzz
- leetcode-412. Fizz Buzz
- LeetCode 412. Fizz Buzz
- 【LeetCode】 412. Fizz Buzz
- LeetCode 412. Fizz Buzz
- LeetCode--412. Fizz Buzz
- 412. Fizz Buzz [LeetCode]
- [leetcode]--412. Fizz Buzz
- Leetcode-412. Fizz Buzz
- [LeetCode]412. Fizz Buzz
- Spring+SpringMVC+MyBatis+easyUI整合基础篇(十二)阶段总结
- 实战设计模式——使用IoC模式(控制反转或依赖注入)实现松散耦合设计(1)
- 81 Search in Rotated Sorted Array II
- Metadata Service 最高频的应用
- Azure Messaging-ServiceBus Messaging消息队列技术系列5-重复消息:at-least-once at-most-once
- Leetcode 412. Fizz Buzz
- JavaWeb从0开始学(二)-----JSP基本语法与编译指令
- Visual Studio 2015/2017 与ASP.NET CORE 联合创建具有SPA模式的Angular2模板
- 使用Nginx+CppCMS构建高效Web应用服务器
- Leetcode 496. Next Greater Element I
- 移动直播技术秒开优化经验(含PPT)
- 33 Search in Rotated Sorted Array
- 什么叫“748工程“?北大方正盗窃火星人源代码的真实含义
- 技术的未来