摘要: Fizz Buzz //循环判断1~n是否是3和5的倍数 class Solution { public List<String> fizzBuzz(int n) { //设置返回的字符串 List<String> str = new ArrayList<String>(); //循环判断1~n是否 阅读全文
posted @ 2022-03-08 15:18 Space-guan 阅读(136) 评论(0) 推荐(0)
摘要: 打乱数组 /** * Your Solution object will be instantiated and called as such: * Solution obj = new Solution(nums); * int[] param_1 = obj.reset(); * int[] p 阅读全文
posted @ 2022-03-08 14:25 Space-guan 阅读(23) 评论(0) 推荐(0)
摘要: 爬楼梯 //设爬x层的梯子的方法有f(x)种,那么f(x) = f(x-1)+f(x-2); //爬1层梯子的方式有一种 //爬2层梯子的方式有两种 //爬3层梯子的方式有三种 //爬4层梯子的方式有五种 class Solution { public int climbStairs(int n)  阅读全文
posted @ 2022-03-08 11:31 Space-guan 阅读(34) 评论(0) 推荐(0)