Leetcode HashTable 题型总结

本文精选了LeetCode上的经典题目,包括有效数独验证、单例数字识别等,并提供了详细的解题思路,如使用HashSet检测数组元素唯一性、位运算解决单例数字问题等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

HashSet 来检测数组元素的唯一性

36. Valid Sudoku https://leetcode.com/problems/valid-sudoku/   

136. Single Number   https://leetcode.com/problems/single-number/应该使用位运算30. Substring with Concatenation of All Words https://leetcode.com/problems/substring-with-concatenation-of-all-words/

有人说这道题和76. Minimum Window Substring比较像,我把它也放在这大家看看

https://leetcode.com/problems/minimum-window-substring/

3. Longest Substring Without Repeating Characters  https://leetcode.com/problems/longest-substring-without-repeating-characters/

use hashtable to record the character in a string and corresponding position.


205. Isomorphic Strings   https://leetcode.com/problems/isomorphic-strings/ 

用char to char 的HashTable记录字符的相互的对应的顺序。

202. Happy Number https://leetcode.com/problems/happy-number/

217. Contains Duplicate HashSet和hashtable的经典题目

219. Contains Duplicate II  https://leetcode.com/problems/contains-duplicate-ii/


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值