文章 2022-02-16 来自:开发者社区

​LeetCode刷题实战508:出现次数最多的子树元素和

今天和大家聊的问题叫做 出现次数最多的子树元素和,我们先来看题面:https://leetcode-cn.com/problems/most-frequent-subtree-sum/Given the root of a binary tree, return the most frequent subtree sum. If there is a tie, return all the va....

​LeetCode刷题实战508:出现次数最多的子树元素和
文章 2022-02-16 来自:开发者社区

​LeetCode刷题实战380:O(1) 时间插入、删除和获取随机元素

今天和大家聊的问题叫做 O(1) 时间插入、删除和获取随机元素,我们先来看题面:https://leetcode-cn.com/problems/insert-delete-getrandom-o1/设计一个支持在平均 时间复杂度 O(1) 下,执行以下操作的数据结构。insert(val):当元素 val 不存在时,向集合中插入该项。remove(val):元素 val 存在时,从集合中移除该....

​LeetCode刷题实战380:O(1) 时间插入、删除和获取随机元素
文章 2022-02-16 来自:开发者社区

​LeetCode刷题实战378:有序矩阵中第 K 小的元素

今天和大家聊的问题叫做 有序矩阵中第 K 小的元素,我们先来看题面:https://leetcode-cn.com/problems/kth-smallest-element-in-a-sorted-matrix/Given an n x n matrix where each of the rows and columns are sorted in ascending order, retu....

文章 2022-02-15 来自:开发者社区

​LeetCode刷题实战217:存在重复元素

今天和大家聊的问题叫做 存在重复元素,我们先来看题面:https://leetcode-cn.com/problems/contains-duplicate/Given an integer array nums, return true if any value appears at least twice in the array, and return false if every ele....

文章 2022-02-15 来自:开发者社区

​LeetCode刷题实战203:移除链表元素

今天和大家聊的问题叫做 移除链表元素,我们先来看题面:https://leetcode-cn.com/problems/remove-linked-list-elements/Remove all elements from a linked list of integers that have value val.题意删除链表中等于给定值 val 的所有节点。示例输入: 1->2->...

文章 2022-02-15 来自:开发者社区

​LeetCode刷题实战27:移除元素

今天和大家聊的问题叫做 移除元素,我们先来看题面:https://leetcode-cn.com/problems/remove-element/Given an array nums and a value val, remove all instances of that value in-place and return the new length.Do not allocate ext....

本页面内关键词为智能算法引擎基于机器学习所生成,如有任何问题,可在页面下方点击"联系我们"与我们沟通。

算法编程

开发者社区在线编程频道官方技术圈。包含算法资源更新,周赛动态,每日一题互动。

+关注
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等