摘要: 翻转数组 描述 原地翻转给出的数组 nums 原地意味着不能使用额外空间 ####【样例】 样例 1: 输入 : nums = [1,2,5] 输出 : [5,2,1] ####【方法】 #include <iostream> #include <cstdio> #include <vector> 阅读全文
posted @ 2022-02-12 21:01 hellozwx 阅读(66) 评论(0) 推荐(0) 编辑
摘要: 杨辉三角 描述 给一整数 n, 返回杨辉三角的前 n 行 0 <= n <= 20 杨辉三角也被叫做帕斯卡三角形. --(Wikipedia) ####【样例】 输入 : n = 4 输出 : [ [1] [1,1] [1,2,1] [1,3,3,1] ] ####【方法一】 #include <i 阅读全文
posted @ 2022-02-12 19:07 hellozwx 阅读(19) 评论(0) 推荐(0) 编辑