Never Settle20250204-leetcode50-pow

20250204-leetcode50-pow

发表于2025-02-04|更新于2025-02-04
|浏览量:|评论数:
文章作者: Jatpeng
文章链接: https://jatpeng.github.io/2025/02/04/20250204-leetcode50-pow/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Never Settle!
cover of previous post
上一篇
剑指 Offer 系列题解
C++ 默认函数介绍1. 构造函数12345class A {public: A(); ~A();}; 2. 析构函数1234class A {public: ~A();}; 3. 拷贝构造函数1234class A {public: A(const A& other);}; 4. 赋值运算符重载1234class A {public: A& operator=(const A& other);}; 5. 移动构造函数1234class A {public: A(A&& other);}; 6. 移动赋值运算符重载1234class A {public: A& operator=(A&& other);};
cover of next post
下一篇
leetcode90子集2
题目90. 子集 II 给你一个整数数组 nums,其中可能包含重复元素,请你返回该数组所有可能的子集(幂集)。解集不能包含重复的子集。返回的解集中,子集可以按任意顺序排列。 解题思路1. 回溯12345678910111213141516171819202122232425262728293031323334class Solution: def subsetsWithDup(self, nums: List[int]) -> List[List[int]]: # 1. 首先对数组排序,使相同的元素相邻 nums.sort() res = [] # 存储最终结果 def backtrack(start: int, path: List[int]): # 2. 将当前路径加入结果集 # path[:] 创建一个新的列表,是当前path的浅拷贝 # 为什么要拷贝?因为path会在后续的回溯过程中被修改 #...

评论
avatar
Jatpeng
Never Settle
文章
41
标签
18
分类
6
Follow Me
公告
欢迎来到我的博客!
这里会分享一些编程、游戏开发和生活感悟。
最新文章
20250903-UE5.6多人游戏插件开发
20250903-UE5.6多人游戏插件开发2025-09-03
20250717-UnrealEngine5C++Multiplayer-Shooter
20250717-UnrealEngine5C++Multiplayer-Shooter2025-07-17
20250714-C++多线程
20250714-C++多线程2025-07-14
20250714-线程池和jobSystem
20250714-线程池和jobSystem2025-07-14
20250711-Aura-UE5_GAS
20250711-Aura-UE5_GAS2025-07-11
©2019 - 2025 By Jatpeng
框架 Hexo|主题 Butterfly