![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Sort
文章平均质量分 58
Nahida_nora
这个作者很懒,什么都没留下…
展开
-
leetcode 3035
统计字符出现的频次,5个a(字符可以成为回文)。将所有字符放在一起考虑,因为字符是可以任意移动。只要奇数个字符的种类,不要超过字符数组的size就可以。原创 2024-03-21 17:17:43 · 197 阅读 · 0 评论 -
leetcode 3075
孩子的幸福值最低也是0,所以选择最大的值,被选孩子的幸福值最高。需要使用排序算法。原创 2024-03-21 10:43:09 · 200 阅读 · 0 评论 -
leetcode 3080
创建数组,数组的顺序是 nums 的key 的排序。原创 2024-03-17 23:22:28 · 470 阅读 · 0 评论 -
leetcode 1657
【代码】leetcode 1657。原创 2023-11-30 10:28:08 · 155 阅读 · 0 评论 -
leetcode 2300
函数在vector中查找符合条件的元素的位置。如果找到了这样的元素,我们将输出它的位置;否则,我们将输出没有找到的消息。如果将double 转为long long, 会损失精度。所以使用upper_bound, 可以得到符合预期的范围。在这个示例中,我们创建了一个包含整数的vector,并使用。函数都用于在有序序列中进行二分查找。原创 2023-11-28 10:26:50 · 176 阅读 · 0 评论 -
leetcode 1235
作者:力扣官方题解经典的数据结构转变,通过3个vector, 转换成二维的vector,3 5 40 , k = 1, 也就是 dp[1] = 503 6 70 , k = 1, 也就是 dp[1] = 50所以是dp[n]== 120。原创 2023-11-06 22:14:20 · 164 阅读 · 0 评论 -
Leetcode 725. Split Linked List in Parts
Leetcode 725. Split Linked List in PartsIf there are N nodes in the linked list root, then there are N / k items in each part, plus the first N%k parts have an extra item.有N个节点,前N%k个部分有 (N/k + N%k )个数字,其余有N/k。Approach #1: Create New Lists [Accepted]cl原创 2020-06-22 06:16:56 · 110 阅读 · 1 评论 -
Leetcode 369. Plus One Linked List
Leetcode 369. Plus One Linked ListSentinel node可能遇到:head 是9的情况, head == 9->9->9, 所以需要引入sentinel node, 0 (sentinel) -> 9 -> 9 -> 9, 然后发现最右边第一个不为9的节点,就是sentinel node, 1 -> 0 -> 0 ->0, return sentinelhead 不是9的情况, 8 -> 9 -&原创 2020-06-22 02:08:28 · 107 阅读 · 0 评论 -
Leetcode 708. Insert into a Sorted Circular Linked List
Leetcode 708. Insert into a Sorted Circular Linked ListApproach 1: Two-Pointers IterationGiven a node from a Circular Linked List which is sorted in ascending order, write a function to insert a value insertVal into the list such that it remains a sorted原创 2020-06-22 01:02:39 · 198 阅读 · 0 评论