5. 最长回文子串 发表于 2021-03-01 更新于 2025-04-08 分类于 algorithm-practice , leetcode 本文字数: 121 阅读时长 ≈ 1 分钟#思路动态规划 < 中心扩展算法 < manacher
25. K 个一组翻转链表 发表于 2021-03-01 更新于 2025-04-08 分类于 algorithm-practice , leetcode 本文字数: 83 阅读时长 ≈ 1 分钟12345678910111213141516171819202122232425262728293031323334353637class Solution{ public: ListNode *reverseKGroup(ListNode *head, int k) { ListNode _header(0, head); ListNode *last = &_header; head = last; int count = 0; while (head) { head = head->next; count++; if (head && count == k) { count -= k; ListNode *tmp_last_next = last->next; reverseK(last, k); head = last = tmp_last_next; } } return _header.next; } void reverseK(ListNode *start, int k) { ListNode *cur = start, *next = start->next; int count = 0; while (count < k) { ListNode *tmp = next->next; next->next = cur; cur = next; next = tmp; count++; } start->next->next = next; start->next = cur; }};
3. 无重复字符的最长子串 发表于 2021-03-01 更新于 2025-04-08 分类于 algorithm-practice , leetcode 本文字数: 61 阅读时长 ≈ 1 分钟#思路滑动窗口
日本语1 发表于 2021-02-15 更新于 2025-04-08 分类于 misc , japanese 本文字数: 190 阅读时长 ≈ 1 分钟#What is Japanese#Japanese Sound System
1055. The World's Richest 发表于 2021-01-22 更新于 2025-04-08 分类于 algorithm-practice , PTA 本文字数: 213 阅读时长 ≈ 1 分钟#题意数据表按照某一列筛选后按另一列排序输出, 重复多次
1109. Group Photo 发表于 2021-01-22 更新于 2025-04-08 分类于 algorithm-practice , PTA 本文字数: 209 阅读时长 ≈ 1 分钟#题意将N个人按照身高排成K行每行N/K个人,后排的人比前排的人高每一排之中, 最高的人在中间, 然后依次在左,右排列相同身高的人按字典序排列