Home avatar

翼仔的博客

N1 安装 Armbian 简单教程

1 前置这一步非必须,如果之前 N1 已经刷了 OpenWrt 或者 Armbian 那么就不需要了,否则最好还是先刷入 webpad 的官改 V2.2 固件 解压后利用双公头 usb 线和 usb-burning-tool 刷入到 N1 中。 具体步骤如

443.压缩字符串

1 问题描述443.压缩字符串 2 解题思路双指针、滑动窗口,注意for循环中不需要fast++。 3 代码 cpp class Solution { public: int compress(vector<char>& chars) { vector<char> res; int cnt = 0; for (int slow = 0, fast

1812.判断国际象棋棋盘中一个格子的颜色

1 问题描述1812.判断国际象棋棋盘中一个格子的颜色 2 解题思路太简单了,不写 3 代码 cpp class Solution { public: bool squareIsWhite(string coordinates) { if ((coordinates[0] - 'a' + 1 - coordinates[1]) % 2 == 0) return false; else return true; } };

438.找到字符串中所有字母异位词

1 问题描述438.找到字符串中所有字母异位词 2 解题思路参照30.串联所有单词串,思路完全一致。 3 代码 cpp class Solution { public: vector<int> findAnagrams(string s, string p) { unordered_map<char, int> mp; for (char &c : p) mp[c]++;

93.复原ip地址

1 问题描述93.复原ip地址 2 解题思路回溯实际上就是转化为树形问题,做深度优先遍历。 3 代码 cpp class Solution { public: vector<string> res; string ip; bool check_ip(string &s) { if (s.size() > 3) return false; if (s[0] == '0') { if