02 2022 档案

摘要:回文数 II 【描述】 判断一个非负整数 n 的二进制表示是否为回文数 0 <= n <= 2^32 - 1 【样例】 样例1 输入: n = 0 输出: True 解释: 0 的二进制表示为:0。 样例2 输入: n = 3 输出: True 解释: 3 的二进制表示为:11。 样例3 输入: n 阅读全文
posted @ 2022-02-18 21:30 hellozwx 阅读(120) 评论(0) 推荐(0) 编辑
摘要:第 3 章 基础篇 VM 和 LINUX 系统(CENTOS)安装 3.1 Centos7——1.VMware15虚拟软件的安装 3.2 Centos7——2.在VMware15上创建虚拟机并安装centos7全过程 3.3 Centos7——3.win10连接centos7(使用win10自带桌面 阅读全文
posted @ 2022-02-16 22:51 hellozwx 阅读(37) 评论(0) 推荐(0) 编辑
摘要:旋转数组 【描述】 给定一个数组,将数组向右移动k步,其中k为非负数。 【样例】 【挑战】 给出尽可能多的解决办法, 至少有三种方法可以解决这个问题. 能够用O(1)的时间复杂度解决问题吗? 【方法一】 #include <iostream> #include <cstdio> #include < 阅读全文
posted @ 2022-02-16 22:17 hellozwx 阅读(55) 评论(0) 推荐(0) 编辑
摘要:翻转数组 描述 原地翻转给出的数组 nums 原地意味着不能使用额外空间 ####【样例】 样例 1: 输入 : nums = [1,2,5] 输出 : [5,2,1] ####【方法】 #include <iostream> #include <cstdio> #include <vector> 阅读全文
posted @ 2022-02-12 21:01 hellozwx 阅读(81) 评论(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 阅读(84) 评论(0) 推荐(0) 编辑
摘要:打印 X 描述 输入一个正整数N, 你需要按样例的方式返回一个字符串列表。 1≤n≤15 #####【方法一】 #include <iostream> #include <cstdio> using namesapce std; int main() { int n = 15; printf("请输 阅读全文
posted @ 2022-02-11 20:24 hellozwx 阅读(100) 评论(0) 推荐(0) 编辑
摘要:描述 输出n以内所有的素数。 保证 n 是100以内的整数。 样例 输入:5 输出:[2, 3, 5] 方法一 #include <iostream> #include <cstdio> #include <cmath> using namespace std; // 判断一个整数是否为素数 boo 阅读全文
posted @ 2022-02-05 23:25 hellozwx 阅读(51) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示