{"id":19866075,"url":"https://github.com/zhenye-na/lintcode","last_synced_at":"2025-10-09T15:21:47.908Z","repository":{"id":94156195,"uuid":"124484527","full_name":"Zhenye-Na/lintcode","owner":"Zhenye-Na","description":"👨‍💻 This repository contains the solutions and explanations to the algorithm problems on LintCode. All are written in Python/Java/C++ and implemented by myself.","archived":false,"fork":false,"pushed_at":"2020-02-26T21:32:14.000Z","size":130908,"stargazers_count":17,"open_issues_count":0,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-02T05:47:07.674Z","etag":null,"topics":["algorithms","coding-interviews","cpp","java","lintcode","lintcode-problems-practice","python"],"latest_commit_sha":null,"homepage":"https://www.lintcode.com/user/zna2","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Zhenye-Na.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-09T03:49:27.000Z","updated_at":"2023-03-30T02:58:05.000Z","dependencies_parsed_at":"2023-04-04T14:47:52.426Z","dependency_job_id":null,"html_url":"https://github.com/Zhenye-Na/lintcode","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Zhenye-Na/lintcode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zhenye-Na%2Flintcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zhenye-Na%2Flintcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zhenye-Na%2Flintcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zhenye-Na%2Flintcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zhenye-Na","download_url":"https://codeload.github.com/Zhenye-Na/lintcode/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zhenye-Na%2Flintcode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001643,"owners_count":26083146,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithms","coding-interviews","cpp","java","lintcode","lintcode-problems-practice","python"],"created_at":"2024-11-12T15:24:56.064Z","updated_at":"2025-10-09T15:21:47.896Z","avatar_url":"https://github.com/Zhenye-Na.png","language":"Python","readme":"\u003ch3 align=\"center\"\u003e\u003cstrong\u003eLintCode Online Judge\u003c/strong\u003e\u003c/h3\u003e\n\n![](https://files.realpython.com/media/Python-Interview-Questions_Watermarked.5c5245ea8638.jpg)\n\n#### [Binary Search](./Binary_Search/)\n\n457.Classical Binary Search  \n14.First Position of Target  \n458.Last Position of Target  \n61.Search for a Range  \n74.First Bad Version  \n447.Search in a Big Sorted Array  \n60.Search Insert Position  \n28.Search a 2D Matrix  \n38.Search a 2D Matrix II (M)  \n462.Total Occurrence of Target  \n585.Maximum Number in Mountain Sequence  \n75.Find Peak Element  \n141.Sqrt(x)  \n586.Sqrt(x) II  \n248.Count of Smaller Number (M)  \n159.Find Minimum in Rotated Sorted Array  \n160.Find Minimum in Rotated Sorted Array II  \n62.Search in Rotated Sorted Array (M)  \n460.Find K Closest Elements (k closest numbers in sorted array)  \n**65.Median of two Sorted Arrays** (H)  \n249.Count of Smaller Number before itself (H)  \n183.Wood Cut (H)  \n437.Copy Books (H)  \n600.Smallest Rectangle Enclosing Black Pixels (H)  \n940.Maximum Absolute Value (M)  \n1626.Salary Adjustment (M)  \n\n\n#### [Tree](./Tree/)\n\n\u003e Divide and Conquer\n\n66.Binary Tree Preorder Traversal  \n67.Binary Tree Inorder Traversal  \n68.Binary Tree Postorder Traversal  \n97.Maximum Depth of Binary Tree  \n480.Binary Tree Paths  \n596.Minimum Subtree  \n628.Maximum Subtree  \n93.Balanced Binary Tree  \n597.Subtree with Maximum Average  \n453.Flatten Binary Tree to Linked List  \n88.Lowest Common Ancestor of a Binary Tree (M)  \n474.Lowest Common Ancestor II  \n578.Lowest Common Ancestor III (M)  \n595.Binary Tree Longest Consecutive Sequence  \n614.Binary Tree Longest Consecutive Sequence II (M)  \n619.Binary Tree Longest Consecutive Sequence III (M)  \n94.Binary Tree Maximum Path Sum (M)  \n376.Binary Tree Path Sum  \n246.Binary Tree Path Sum II  \n472.Binary Tree Path Sum III (H)  \n863.Binary Tree Path Sum IV (M)  \n378.Convert Binary Tree to Doubly Linked List (M)  \n650.Find Leaves of Binary Tree  \n\n\u003e **Binary Search Tree**\n\n95.Validate Binary Search Tree (M)  \n86.Binary Search Tree Iterator (H)  \n448.Inorder Successor in BST (M)  \n11.Search Range in Binary Search Tree (M)  \n85.Insert Node in a Binary Search Tree  \n87.Remove Node in Binary Search Tree (H)\n\n\n#### [BFS](./BFS/)\n\n69.Binary Tree Level Order Traversal  \n7.Serialize and Deserialize Binary Tree  \n71.Binary Tree Zigzag Level Order Traversal  \n70.Binary Tree Level Order Traversal II  \n242.Convert Binary Tree to Linked Lists by Depth  \n178.Graph Valid Tree  \n137.Clone Graph  \n618.Search Graph Nodes  \n127.Topological Sorting  \n615.Course Schedule  \n616.Course Schedule II  \n605.Sequence Reconstruction  \n433.Number of Islands  \n677.Number of Big Islands  \n598.Zombie in Matrix  \n611.Knight Shortest Path  \n573.Build Post Office II  \n431.Connected Component in Undirected Graph  \n120.Word Ladder (H)  \n121.Word Ladder II (H)  \n630.Knight Shortest Path II (M)  \n1446.01 Matrix Walking Problem (M)  \n375.Clone Binary Tree  \n477.Surrounded Regions  \n\n\n#### [DFS](./DFS/)\n\n15.Permutations (M)  \n16.Permutations II (M)  \n17.Subsets (M)  \n18.Subsets II (M)  \n152.Combinations (M)  \n135.Combination Sum (M)  \n153.Combination Sum II (M)    \n425.Letter Combinations of a Phone Number (M)  \n426.Restore IP Addresses (M)  \n136.Palindrome Partitioning (M)  \n121.Word Ladder II (H)  \n52.Next Permutation  \n190.Next Permutation II  \n33.N-Queens  \n790.Parser  \n652.Factorization  \n1353.Sum Root to Leaf Numbers  \n1031.Is Graph Bipartite\n\n\n#### [Linked List](./Linked_List)\n\n450.Reverse Nodes in k-Group  \n165.Merge Two Sorted Lists  \n36.Reverse Linked List II  \n511.Swap Two Nodes in Linked List  \n98.Sort List  \n99.Reorder List  \n170.Rotate List  \n96.Partition List  \n105.Copy List with Random Pointer  \n102.Linked List Cycle  \n103.Linked List Cycle II (H)  \n380.Intersection of Two Linked Lists  \n106.Convert Sorted List to Binary Search Tree  \n372.Delete Node in a Linked List  \n\n\n#### [Array](./Array)\n\n41.Maximum Subarray  \n604.Window Sum  \n138.Subarray Sum  \n139.Subarray Sum Closest  \n547.Intersection of Two Arrays (3 approaches)  \n\n\n#### [Two Pointers](./Two_Pointers/)\n\n100.Remove Duplicates from Sorted Array  \n101.Remove Duplicates from Sorted Array II  \n39.Recover Rotated Sorted Array  \n64.Merge Sorted Array  \n6.Merge Two Sorted Arrays (Merge Sorted Array II)  \n49.Sort Letters by Case  \n148.Sort Colors  \n143.Sort Colors II  \n144.Interleaving Positive and Negative Numbers  \n373.Partition Array by Odd and Even  \n415.Valid Palindrome  \n461.Kth Smallest Numbers in Unsorted Array  \n521.Remove Duplicate Numbers in Array  \n539.Move Zeroes  \n56.Two Sum  \n57.3-Sum  \n58.4Sum  \n59.3-Sum Closest  \n533.Two Sum - Closest to target\n607.Two Sum III - Data structure design  \n587.Two Sum - Unique pairs  \n609.Two Sum - Less than or equal to target  \n443.Two Sum - Greater than target  \n610.Two Sum - Difference equals to target  \n32.Minimum Window Substring  \n384.Longest Substring Without Repeating Characters  \n386.Longest Substring with At Most K Distinct Characters  \n406.Minimum Size Subarray Sum  \n461.Kth Smallest Numbers in Unsorted Array  \n363.Trapping Rain Water  \n1487.Judging Triangle\n\n#### [Stack](./Stack/)\n\n575.Decode String (Expression Expand)  \n494.Implement Stack by Two Queues  \n40.Implement Queue by Two Stacks  \n224.Implement Three Stacks by Single Array (M)  \n955.Implement Queue by Circular Array  \n**12.Min Stack (Monotonic Stack)** (M)  \n**122.Largest Rectangle in Histogram** (H)  \n**510.Maximal Rectangle** (H)  \n**126.Max Tree** (H)  \n\n\u003e **Iterator 相关题**\n\n528.Flatten Nested List Iterator  \n540.Zigzag Iterator  \n541.Zigzag Iterator II  \n601.Flatten 2D Vector  \n\n\n#### [Hash](./Hash/)\n\n129.Rehashing  \n134.LRU Cache  \n105.Copy List with Random Pointer  \n171.Anagrams  \n124.Longest Consecutive Sequence  \n\n\n#### [Heap](./Heap/)\n\n104.Merge K Sorted Lists  \n1272.Kth Smallest Element in a Sorted Matrix  \n130.Heapify  \n4.Ugly Number II  \n401.Kth Smallest Number in Sorted Matrix  \n465.Kth Smallest Sum In Two Sorted Arrays (H)  \n471.Top K Frequent Words  \n486.Merge K Sorted Arrays  \n543.Kth Largest in N Arrays  \n544.Top k Largest Numbers  \n545.Top k Largest Numbers II  \n577.Merge K Sorted Interval Lists  \n612.K Closest Points  \n613.High Five  \n81.Find Median from Data Stream  \n360.Sliding Window Median  \n\n\n#### [Dynamic Programming](./Dynamic_Programming/)\n\n109.Triangle  \n110.Minimum Path Sum  \n114.Unique Paths  \n115.Unique Paths II  \n679.Unique Paths III  \n\n191.Maximum Product Subarray  \n\n\u003e **Backpack**\n\n0-1 背包问题\n\n[Backpack]()  \n[Backpack II]()  \n[Backpack V]()  \n[Backpack VI - 564.Combination Sum IV (M)]()  \n\n\n多重背包问题\n\n[Backpack VII]()  \n[Backpack VIII]()\n\n完全背包问题\n\n[Backpack III]()  \n[Backpack IV]()  \n\n\n#### [Union Find](./Union_Find/)\n\n433.Number of Islands  \n178.Graph Valid Tree  \n431.Connected Component in Undirected Graph (M)  \n589.Connecting Graph (M)  \n1070.Accounts Merge  \n589.Connecting Graph  \n590.Connecting Graph II  \n591.Connecting Graph III  \n434.Number of Islands II  \n805.Maximum Association Set  \n1396.Set Union  \n1569.Social Network\n\n#### [Trie](./Trie/)\n\n442.Implement Trie (Prefix Tree)  \n1090.Map Sum Pairs  \n559.Trie Service  \n132.Word Search II  \n634.Word Squares  \n\n\n#### [Sweep Line](./Sweep_Line/)\n\n391.Number of Airplanes in the Sky  \n919.Meeting Rooms II  \n821.Time Intersection\n\n\n#### [Bit Manipulation](./Bit_Manipulation/)\n\n82.Single Number  \n83.Single Number II  \n84.Single Number III  \n824.Single Number IV  \n\n\n#### [String](./String/)\n\n8.Rotate String  \n53.Reverse Words in a String  \n927.Reverse Words in a String II  \n1173.Reverse Words in a String III  \n1041.Reorganize String  \n78.Longest Common Prefix  \n784.The Longest Common Prefix II  \n\n\n#### [Sort](./Sort/)\n\n80.Median  \n5.Kth Largest Element  \n894.Pancake Sorting\n\n\n\n#### [Math](./Math/)\n\n730.Sum of All Subsets  \n\n\n\n#### [Others](./Others/)\n\n842.Origami  \n1022.Valid Tic-Tac-Toe State  \n\n\n\n#### Resources\n\nBelow are some good resources to look through:\n\n- [Big-O Cheat Sheet](http://www.bigocheatsheet.com/), PDF version can be download [here](http://www.bigocheatsheet.com/pdf/big-o-cheatsheet.pdf) or be found in this repo [here](./big-o-cheatsheet.pdf)\n- Sergey, [Java Collections Complexity cheatsheet](https://gist.github.com/iSergius/e06963c6eca0a639023666097227427c), txt file can be found [here](./complexityjava.txt)\n- Python Complexity Analysis, txt file can be found [here](complexitypython.txt)\n\n\n\u003cp align=\"center\"\u003e\n\u003cspan style=\"color:#1d58a6\"\u003e\u003csup\u003e \u0026copy; Copyright Zhenye Na \u003cimg src=\"https://cdn3.iconfinder.com/data/icons/coffee-11/500/Coffee_brain-512.png\" width=\"20\" height=\"auto\" /\u003e May 2018 \u003c/sup\u003e\u003c/span\u003e\n\u003c/p\u003e","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhenye-na%2Flintcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhenye-na%2Flintcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhenye-na%2Flintcode/lists"}