摘要:
三道题 第一题 题目链接:https://leetcode-cn.com/problems/first-missing-positive/ 个人题解: 不用额外空间的桶排序: 保证 \(1\) 出现在 \(nums[0]\) 的位置上,..., \(n\) 出现在 \(nums[n-1]\) 的位置 阅读全文
posted @ 2022-04-19 13:59
黑VS白-清墨
阅读(79)
评论(0)
推荐(0)
摘要:
题目链接:https://leetcode-cn.com/problems/shortest-distance-to-a-character/ 个人题解: 两次遍历就可以了。 先求 \(s[i]\) 到其左侧最近的字符 \(ch\) 的距离,再求 \(s[i]\) 到其右侧最近的字符 \(ch\) 阅读全文
posted @ 2022-04-19 12:16
黑VS白-清墨
阅读(11)
评论(0)
推荐(0)