2.13 Bảng băm (Hash Table)

STTTiêu đềLời giảiĐộ khóĐộ phức tạp thời gianĐộ phức tạp bộ nhớYêu thíchTỷ lệ AC (Acceptance)
0001Tổng 2 số (Two Sum)GoEasyO(n)O(n)49.7%
0003Chuỗi con dài nhất không lặp ký tự (Longest Substring Without Repeating Characters)GoMediumO(n)O(1)❤️33.8%
0012Chuyển số nguyên sang số La Mã (Integer to Roman)GoMedium62.0%
0013Chuyển số La Mã sang số nguyên (Roman to Integer)GoEasy58.6%
0017Tổ hợp chữ cái của số điện thoại (Letter Combinations of a Phone Number)GoMedium56.6%
0030Chuỗi con là phép nối tất cả các từ (Substring with Concatenation of All Words)GoHardO(n)O(n)❤️31.2%
0036Sudoku hợp lệ (Valid Sudoku)GoMediumO(n^2)O(n^2)58.1%
0037Giải Sudoku (Sudoku Solver)GoHardO(n^2)O(n^2)❤️57.7%
0041Số dương nhỏ nhất bị thiếu (First Missing Positive)GoHard36.7%
0049Nhóm các từ đảo chữ (Group Anagrams)GoMediumO(n log n)O(n)66.8%
0073Đặt số 0 cho ma trận (Set Matrix Zeroes)GoMedium51.3%
0076Chuỗi con cửa sổ nhỏ nhất (Minimum Window Substring)GoHardO(n)O(n)❤️40.9%
0105Xây dựng cây nhị phân từ duyệt tiền thứ tự và trung thứ tự (Construct Binary Tree from Preorder and Inorder Traversal)GoMedium61.6%
0106Xây dựng cây nhị phân từ duyệt trung thứ tự và hậu thứ tự (Construct Binary Tree from Inorder and Postorder Traversal)GoMedium60.0%
0126Thang từ II (Word Ladder II)GoHard27.5%
0127Thang từ (Word Ladder)GoHard37.2%
0128Dãy liên tiếp dài nhất (Longest Consecutive Sequence)GoMedium48.5%
0138Sao chép danh sách với con trỏ ngẫu nhiên (Copy List with Random Pointer)GoMediumO(n)O(1)51.4%
0141Chu trình trong danh sách liên kết (Linked List Cycle)GoEasy47.5%
0142Chu trình trong danh sách liên kết II (Linked List Cycle II)GoMedium48.8%
0146Bộ nhớ đệm LRU (LRU Cache)GoMedium40.7%
0160Giao nhau của hai danh sách liên kết (Intersection of Two Linked Lists)GoEasy54.4%
0169Phần tử chiếm đa số (Majority Element)GoEasy63.9%
0187Các chuỗi DNA lặp lại (Repeated DNA Sequences)GoMedium47.0%
0202Số hạnh phúc (Happy Number)GoEasyO(log n)O(1)54.8%
0205Chuỗi đẳng cấu (Isomorphic Strings)GoEasyO(log n)O(n)42.9%
0208Cài đặt Trie (cây tiền tố) (Implement Trie (Prefix Tree))GoMedium62.8%
0217Có phần tử trùng (Contains Duplicate)GoEasyO(n)O(n)61.4%
0219Có phần tử trùng II (Contains Duplicate II)GoEasyO(n)O(n)42.6%
0229Phần tử chiếm đa số II (Majority Element II)GoMedium45.1%
0242Anagram hợp lệ (Valid Anagram)GoEasyO(n)O(n)63.1%
0264Số xấu II (Ugly Number II)GoMedium46.2%
0268Số bị thiếu (Missing Number)GoEasy62.6%
0290Mẫu từ (Word Pattern)GoEasyO(n)O(n)41.7%
0299Bò và bò tót (Bulls and Cows)GoMedium49.4%
0347Top K phần tử xuất hiện nhiều nhất (Top K Frequent Elements)GoMediumO(n)O(n)64.2%
0349Giao của hai mảng (Intersection of Two Arrays)GoEasyO(n)O(n)70.9%
0350Giao của hai mảng II (Intersection of Two Arrays II)GoEasyO(n)O(n)56.0%
0383Thư tống tiền (Ransom Note)GoEasy58.3%
0387Ký tự duy nhất đầu tiên trong chuỗi (First Unique Character in a String)GoEasy59.6%
0389Tìm ký tự khác biệt (Find the Difference)GoEasy59.9%
0395Chuỗi con dài nhất có ít nhất K ký tự lặp lại (Longest Substring with At Least K Repeating Characters)GoMedium44.8%
0409Palindrome dài nhất (Longest Palindrome)GoEasy54.2%
0421XOR lớn nhất của hai số trong mảng (Maximum XOR of Two Numbers in an Array)GoMedium54.0%
0423Khôi phục các chữ số gốc từ tiếng Anh (Reconstruct Original Digits from English)GoMedium51.2%
0424Thay thế để có chuỗi lặp lại dài nhất (Longest Repeating Character Replacement)GoMedium52.0%
0433Đột biến gen tối thiểu (Minimum Genetic Mutation)GoMedium52.4%
0438Tìm tất cả anagram trong chuỗi (Find All Anagrams in a String)GoMediumO(n)O(1)50.2%
0447Số lượng boomerang (Number of Boomerangs)GoMediumO(n)O(1)54.9%
0448Tìm tất cả số biến mất trong mảng (Find All Numbers Disappeared in an Array)GoEasy59.9%
0451Sắp xếp ký tự theo tần suất (Sort Characters By Frequency)GoMediumO(n log n)O(1)70.1%
0454Tổng 4 số II (4Sum II)GoMediumO(n^2)O(n)57.2%
0457Vòng lặp mảng vòng tròn (Circular Array Loop)GoMedium32.6%
0460Bộ nhớ đệm LFU (LFU Cache)GoHard43.0%
0480Trung vị cửa sổ trượt (Sliding Window Median)GoHard41.1%
0491Các dãy con không giảm (Non-decreasing Subsequences)GoMedium60.2%
0496Phần tử lớn hơn tiếp theo I (Next Greater Element I)GoEasy71.4%
0500Hàng phím (Keyboard Row)GoEasy69.6%
0508Tổng cây con xuất hiện nhiều nhất (Most Frequent Subtree Sum)GoMedium64.9%
0519Lật ma trận ngẫu nhiên (Random Flip Matrix)GoMedium40.0%
0523Tổng mảng con liên tiếp (Continuous Subarray Sum)GoMedium28.5%
0525Mảng liền kề (Contiguous Array)GoMedium46.8%
0532Các cặp K-diff trong mảng (K-diff Pairs in an Array)GoMedium41.2%
0535Mã hóa và giải mã TinyURL (Encode and Decode TinyURL)GoMedium86.0%
0554Bức tường gạch (Brick Wall)GoMedium53.6%
0560Tổng mảng con bằng K (Subarray Sum Equals K)GoMedium43.7%
0567Hoán vị trong chuỗi (Permutation in String)GoMedium44.3%
0575Phân phát kẹo (Distribute Candies)GoEasy66.5%
0594Dãy con hài hòa dài nhất (Longest Harmonious Subsequence)GoEasy53.5%
0599Tổng chỉ số nhỏ nhất của hai danh sách (Minimum Index Sum of Two Lists)GoEasy53.4%
0609Tìm tệp trùng lặp trong hệ thống (Find Duplicate File in System)GoMedium67.7%
0632Khoảng nhỏ nhất bao phủ phần tử từ K danh sách (Smallest Range Covering Elements from K Lists)GoHard61.0%
0645Sai lệch tập hợp (Set Mismatch)GoEasy42.7%
0648Thay thế từ (Replace Words)GoMediumO(n)O(n)62.7%
0653Hai tổng IV - Đầu vào là BST (Two Sum IV - Input is a BST)GoEasy61.0%
0676Cài đặt từ điển ma thuật (Implement Magic Dictionary)GoMediumO(n)O(n)56.9%
0677Cặp tổng theo tiền tố (Map Sum Pairs)GoMedium56.8%
0690Tầm quan trọng của nhân viên (Employee Importance)GoMedium65.6%
0692Top K từ xuất hiện nhiều nhất (Top K Frequent Words)GoMedium57.2%
0697Bậc của một mảng (Degree of an Array)GoEasy56.0%
0705Thiết kế HashSet (Design HashSet)GoEasy65.6%
0706Thiết kế HashMap (Design HashMap)GoEasy64.7%
0710Chọn ngẫu nhiên với danh sách đen (Random Pick with Blacklist)GoHardO(n)O(n)33.5%
0720Từ dài nhất trong từ điển (Longest Word in Dictionary)GoMediumO(n)O(n)52.0%
0726Số lượng nguyên tử (Number of Atoms)GoHardO(n)O(n)❤️52.2%
0745Tìm kiếm tiền tố và hậu tố (Prefix and Suffix Search)GoHard41.2%
0748Từ hoàn chỉnh ngắn nhất (Shortest Completing Word)GoEasy59.3%
0752Mở khóa (Open the Lock)GoMedium55.6%
0763Phân hoạch nhãn (Partition Labels)GoMedium79.7%
0767Sắp xếp lại chuỗi (Reorganize String)GoMedium52.9%
0771Đá quý và đá thường (Jewels and Stones)GoEasy88.2%
0781Thỏ trong rừng (Rabbits in Forest)GoMedium54.7%
0791Sắp xếp chuỗi tùy chỉnh (Custom Sort String)GoMedium69.1%
0792Số lượng dãy con khớp (Number of Matching Subsequences)GoMedium51.6%
0811Số lượt truy cập theo miền con (Subdomain Visit Count)GoMedium75.5%
0815Các tuyến xe buýt (Bus Routes)GoHard45.6%
0817Các thành phần của danh sách liên kết (Linked List Components)GoMedium57.7%
0819Từ phổ biến nhất (Most Common Word)GoEasy44.7%
0820Mã hóa ngắn cho các từ (Short Encoding of Words)GoMedium60.6%
0823Cây nhị phân với thừa số (Binary Trees With Factors)GoMedium49.7%
0828Đếm ký tự duy nhất của mọi chuỗi con của chuỗi đã cho (Count Unique Characters of All Substrings of a Given String)GoHard51.6%
0846Xếp bài liên tiếp (Hand of Straights)GoMedium56.2%
0859Chuỗi bạn bè (Buddy Strings)GoEasy29.2%
0884Các từ không chung từ hai câu (Uncommon Words from Two Sentences)GoEasy66.4%
0888Đổi kẹo công bằng (Fair Candy Swap)GoEasy60.7%
0890Tìm và thay thế mẫu (Find and Replace Pattern)GoMedium77.6%
0895Ngăn xếp tần suất lớn nhất (Maximum Frequency Stack)GoHardO(n)O(n)66.6%
0904Trái cây vào giỏ (Fruit Into Baskets)GoMedium43.7%
0911Bầu cử trực tuyến (Online Election)GoMedium52.2%
0914X cùng loại trong bộ bài (X of a Kind in a Deck of Cards)GoEasy31.2%
0916Tập con của từ (Word Subsets)GoMedium53.7%
0923Tổng 3 số với bội số (3Sum With Multiplicity)GoMedium45.3%
0930Mảng con nhị phân có tổng (Binary Subarrays With Sum)GoMediumO(n)O(n)❤️52.2%
0953Xác minh từ điển người ngoài hành tinh (Verifying an Alien Dictionary)GoEasy54.5%
0961Phần tử lặp N lần trong mảng kích thước 2N (N-Repeated Element in Size 2N Array)GoEasy76.1%
0966Bộ kiểm tra chính tả nguyên âm (Vowel Spellchecker)GoMedium51.4%
0970Số nguyên mạnh (Powerful Integers)GoMedium43.6%
0981Kho lưu trữ key-value theo thời gian (Time Based Key-Value Store)GoMedium52.2%
0987Duyệt theo cột dọc của cây nhị phân (Vertical Order Traversal of a Binary Tree)GoHard45.1%
0992Mảng con có K số nguyên khác nhau (Subarrays with K Different Integers)GoHardO(n)O(n)❤️54.6%
0997Tìm thẩm phán của thị trấn (Find the Town Judge)GoEasy49.5%
1002Tìm các ký tự chung (Find Common Characters)GoEasy68.5%
1010Cặp bài hát có tổng thời lượng chia hết cho 60 (Pairs of Songs With Total Durations Divisible by 60)GoMedium52.8%
1048Chuỗi từ dài nhất (Longest String Chain)GoMedium59.3%
1054Mã vạch cách xa nhau (Distant Barcodes)GoMedium45.9%
1074Số lượng ma trận con có tổng bằng mục tiêu (Number of Submatrices That Sum to Target)GoHard69.5%
1079Số khả năng sắp xếp gạch chữ (Letter Tile Possibilities)GoMedium76.0%
1122Sắp xếp tương đối mảng (Relative Sort Array)GoEasy68.6%
1123Tổ tiên chung thấp nhất của các lá sâu nhất (Lowest Common Ancestor of Deepest Leaves)GoMedium70.9%
1128Số cặp domino tương đương (Number of Equivalent Domino Pairs)GoEasy47.1%
1160Tìm các từ có thể tạo từ các ký tự (Find Words That Can Be Formed by Characters)GoEasy67.5%
1170So sánh chuỗi theo tần suất của ký tự nhỏ nhất (Compare Strings by Frequency of the Smallest Character)GoMedium61.5%
1171Xóa các nút liên tiếp có tổng bằng 0 (Remove Zero Sum Consecutive Nodes from Linked List)GoMedium43.2%
1178Số từ hợp lệ cho mỗi câu đố (Number of Valid Words for Each Puzzle)GoHard46.3%
1189Số lượng bóng bay tối đa (Maximum Number of Balloons)GoEasy61.0%
1202Chuỗi nhỏ nhất sau khi hoán đổi (Smallest String With Swaps)GoMedium57.7%
1207Số lần xuất hiện duy nhất (Unique Number of Occurrences)GoEasy73.5%
1275Tìm người thắng trong trò tic-tac-toe (Find Winner on a Tic Tac Toe Game)GoEasy54.2%
1296Chia mảng thành các bộ K số liên tiếp (Divide Array in Sets of K Consecutive Numbers)GoMedium56.5%
1396Thiết kế hệ thống tàu điện ngầm (Design Underground System)GoMedium73.6%
1442Đếm bộ ba tạo hai mảng có XOR bằng nhau (Count Triplets That Can Form Two Arrays of Equal XOR)GoMedium76.1%
1461Kiểm tra chuỗi có chứa tất cả mã nhị phân độ dài K không (Check If a String Contains All Binary Codes of Size K)GoMedium56.6%
1512Số lượng cặp tốt (Number of Good Pairs)GoEasy88.2%
1600Thừa kế ngai vàng (Throne Inheritance)GoMedium63.6%
1624Chuỗi con lớn nhất giữa hai ký tự giống nhau (Largest Substring Between Two Equal Characters)GoEasy59.1%
1636Sắp xếp mảng theo tần suất tăng dần (Sort Array by Increasing Frequency)GoEasy69.5%
1640Kiểm tra tạo mảng bằng phép nối (Check Array Formation Through Concatenation)GoEasy56.2%
1647Số lần xóa tối thiểu để tần suất ký tự là duy nhất (Minimum Deletions to Make Character Frequencies Unique)GoMedium59.1%
1656Thiết kế luồng có thứ tự (Design an Ordered Stream)GoEasy85.2%
1657Xác định hai chuỗi có gần nhau không (Determine if Two Strings Are Close)GoMedium56.3%
1658Số thao tác tối thiểu để giảm X về 0 (Minimum Operations to Reduce X to Zero)GoMedium37.6%
1674Số bước tối thiểu để mảng bù nhau (Minimum Moves to Make Array Complementary)GoMedium38.7%
1679Số lượng tối đa các cặp có tổng K (Max Number of K-Sum Pairs)GoMedium57.3%
1684Đếm số chuỗi nhất quán (Count the Number of Consistent Strings)GoEasy82.3%
1695Giá trị xóa tối đa (Maximum Erasure Value)GoMedium57.6%
1742Số lượng bóng tối đa trong một hộp (Maximum Number of Balls in a Box)GoEasy73.6%
1748Tổng các phần tử duy nhất (Sum of Unique Elements)GoEasy76.3%
1763Chuỗi con "nice" dài nhất (Longest Nice Substring)GoEasy61.5%
2043Hệ thống ngân hàng đơn giản (Simple Bank System)GoMedium65.2%
2166Thiết kế Bitset (Design Bitset)GoMedium31.8%
2170Số thao tác tối thiểu để mảng xen kẽ (Minimum Operations to Make the Array Alternating)GoMedium33.2%
------------------------------------------------------------------------------------------------------------------------------------------------