摘要:problem 892. Surface Area of 3D Shapes solution#1: code 注意,不是简单的投影面积的2倍; 参考 1. leetcode_easy_math_892. Surface Area of 3D Shapes; 2. Grandyang; 完
阅读全文
摘要:problem 1636. Sort Array by Increasing Frequency solution#1: sort code 注意: 1. sort的用法,特别是第三个参数的使用; 2. lamda函数; 参考 1. leetcode_easy_array_1636. Sort Ar
阅读全文
摘要:problem 1640. Check Array Formation Through Concatenation solution#1: code 参考 1. leetcode_easy_array_1640. Check Array Formation Through Concatenation
阅读全文
摘要:problem 942. DI String Match solution#1: code 参考 1. leetcode_easy_math_942. DI String Match; 2. Grandyang; 完
阅读全文
摘要:problem 1281. Subtract the Product and Sum of Digits of an Integer solution#1: code 参考 1. leetcode_easy_math_1281. Subtract the Product and Sum of Dig
阅读全文
摘要:problem 1237. Find Positive Integer Solution for a Given Equation solution#1: two loop; code solution#2: binary search; code 参考 1. leetcode_easy_math_
阅读全文
摘要:problem 1317. Convert Integer to the Sum of Two No-Zero Integers solution#1:检查数值中是否含有字符0; code: solution#2: 通过判断除以10的余数来判断是否含有符号0; code: 注意,理解题目的意思,要求
阅读全文
摘要:problem 1175. Prime Arrangements solution#1: 根据数值的范围直接给出范围内的素数进行计算; code solution#2: 求解素数的个数,然后求解素数和非素数的阶乘之积。 code: 注意1,两个int类型的数据相乘之后的数据范围及类型; 注意2,数据
阅读全文
摘要:problem 1523. Count Odd Numbers in an Interval Range solution#1: 分别计算0到low-1和0到high的奇数数目,然后做差即可。 code solution#2:根绝high和low的奇偶性判断。 code 参考 1. leetcode
阅读全文
摘要:problem 1025. Divisor Game solution#1: code 参考 1. leetcode_easy_math_1025. Divisor Game; 2. LeetCode.1025-除数游戏(Divisor Game); 3. 1025. 除数博弈(Divisor Ga
阅读全文
摘要:problem 1009. Complement of Base 10 Integer solution#1:XOR. code 参考 1. leetcode_easy_math_1009. Complement of Base 10 Integer; 完
阅读全文
摘要:problem 606. Construct String from Binary Tree solution#1: 使用原函数递归; code solution#2: 使用额外函数递归; code 参考 1. leetcode_easy_string_606. Construct String f
阅读全文
摘要:problem 1332. Remove Palindromic Subsequences solution#1:判断是否为回文; code solution#2:在主要函数中直接判断回文; code solution#3:使用string的rbegin/rend特性; code 注意,不明白为什么
阅读全文
摘要:problem 1309. Decrypt String from Alphabet to Integer Mapping solution#1:将问题分为两部分进行判断; code 参考 1. leetcode_easy_string_1309. Decrypt String from Alpha
阅读全文
摘要:problem 1221. Split a String in Balanced Strings solution#1: 括号匹配问题; code 参考 1. leetcode_easy_string_1221. Split a String in Balanced Strings; 2. 【Lee
阅读全文
摘要:problem 1417. Reformat The String solution#1: code class Solution { public: string reformat(string s) { string res = ""; string digits = ""; string le
阅读全文
摘要:problem 1374. Generate a String With Characters That Have Odd Counts solution#1: code solution#2: one line; code 参考 1. leetcode_easy_string_1374. Gene
阅读全文
摘要:problem 1370. Increasing Decreasing String 理解题意; solution#1: code 参考 1. leetcode_easy_string_1370. Increasing Decreasing String; 完
阅读全文
摘要:problem 1422. Maximum Score After Splitting a String solution#1: code class Solution { public: int maxScore(string s) { int left = 0, right = 0; for(a
阅读全文
摘要:参考 1. 004 - 指针和引用的区别是什么? 完
阅读全文
摘要:参考 1. 深入理解 CPU 的分支预测(Branch Prediction)模型; 2. 001 - 为什么处理一段已排序的数组比处理一段未排序的数组快? 完
阅读全文
摘要:参考 1. C++ 头文件是使用 .h 还是 .hpp; 2. stackoverflow-top-cpp; 3. 【我的C语言学习进阶之旅】什么是.hpp文件? 完
阅读全文
摘要:参考 1. 013 - #include <filename> 和 #include "filename" 的区别是什么; 2. stackoverflow-top-cpp; 完
阅读全文
摘要:参考 1. 010 - static_cast, dynamic_cast, const_cast 和 reinterpret_cast 怎么用; 2. stackoverflow-top-cpp; 完
阅读全文
摘要:问题 之前新安装系统只有vi没有vim,想要按使用方向键按上下左右时,总是会变成ABCD,然后按键HJKL又会变成上下左右,而且左下端没有插入等模式的标识,简直让人极度抓狂啊! 原因 其实这个问题是由ubuntu系统自带的 vi版本太老导致的,所以解决方法就是安装新版的vi编辑器即可: 首先卸载旧版
阅读全文
摘要:root ALL=(ALL:ALL) ALL The first field indicates the username that the rule will apply to(root). First “ALL” indicates that this rule applies to all h
阅读全文
摘要:要确定轴的正旋转方向,如下图所示,用右手的大拇指指向轴的正方向,弯曲手指。那么手指所指示的方向即是轴的正旋转方向。 参考 1. 3D数学基础(一)——左手坐标系和右手坐标系; 完
阅读全文
摘要:进入Recovery模式, 进入ubuntu recovery mode的Root选项之后, mount -o remount,rw / #对根目录重新挂载为读/写 chmod u+w /etc/sudoers vim /etc/sudoers chmod u-w /etc/sudoers moun
阅读全文
摘要:参考 1. extern “C”的作用详解; 2. 【C++入门】C和C++混合编程超详细讲解_正在起飞的蜗牛的博客-CSDN博客; 3. C++和C的混合编译_iheal的博客-CSDN博客; 完
阅读全文
摘要:QT用于将CANFD写入ASC/BLF文件的过程中,报如下错误: c:\Users\qt\work\qt\qtbase\src\winmain\qtmain_win.cpp:111: error: undefined reference to `qMain(int, char**)' 根据参考链接,
阅读全文
摘要:前言 步骤 step1:生成Release版本的可执行文件; step2:将生成的可执行文件复制到一个空白文件夹; step3:以QT5.14.2+MinGW7.3.0-64bit开发环境为例,按照以下路径打开Qt5.14.2(MinGW7.3.0 64bit)的命令行界面,运行windeployq
阅读全文