{"id":34837210,"url":"https://github.com/palemoky/leetcode","last_synced_at":"2025-12-25T16:09:51.478Z","repository":{"id":181342760,"uuid":"666608650","full_name":"palemoky/leetcode","owner":"palemoky","description":"LeetCode Solutions in Go, Python, and Rust","archived":false,"fork":false,"pushed_at":"2025-11-04T10:57:05.000Z","size":7580,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-04T12:21:58.564Z","etag":null,"topics":["algorithms","go","leetcode","python","rust"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/palemoky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-07-15T01:42:47.000Z","updated_at":"2025-11-04T10:57:09.000Z","dependencies_parsed_at":"2025-07-14T11:22:57.147Z","dependency_job_id":"a2f172c6-8b25-42e9-a30f-db6e553ceaa7","html_url":"https://github.com/palemoky/leetcode","commit_stats":null,"previous_names":["palemoky/leetcode"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/palemoky/leetcode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palemoky%2Fleetcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palemoky%2Fleetcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palemoky%2Fleetcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palemoky%2Fleetcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/palemoky","download_url":"https://codeload.github.com/palemoky/leetcode/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palemoky%2Fleetcode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28032384,"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-12-25T02:00:05.988Z","response_time":58,"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","go","leetcode","python","rust"],"created_at":"2025-12-25T16:08:03.424Z","updated_at":"2025-12-25T16:09:51.465Z","avatar_url":"https://github.com/palemoky.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LeetCode Solutions\n\n[![Test](https://github.com/palemoky/leetcode/actions/workflows/leetbot.yml/badge.svg)](https://github.com/palemoky/leetcode/actions)\n\n\u003e Computer science is no more about computers than astronomy is about telescopes. — E. W. Dijkstra  \n\u003e 计算机科学并不在于计算机，正如天文学并不在于望远镜。\n\n## Contents\n\n- [LeetCode Solutions](#leetcode-solutions)\n  - [Contents](#contents)\n  - [Directory Structure](#directory-structure)\n  - [Essential Algorithm Fundamentals](#essential-algorithm-fundamentals)\n    - [Algorithm Basics You Must Master:](#algorithm-basics-you-must-master)\n    - [Core Algorithm Ideas:](#core-algorithm-ideas)\n  - [Must-Know Classic LeetCode Problems by Category](#must-know-classic-leetcode-problems-by-category)\n  - [Visualization Algorithm Tools](#visualization-algorithm-tools)\n  - [Algorithm Learning Resources](#algorithm-learning-resources)\n  - [Todo List](#todo-list)\n\nWelcome! This repository contains my solutions to LeetCode problems, implemented in **Go**, **Python**, and **Rust**.\n\nEach problem is organized by language and directory. Solutions include clean code, unit tests, and concise explanations where appropriate.\n\n## Directory Structure\n\n- 📂 `go/` — Go solutions\n- 📂 `python/` — Python solutions\n- 📂 `rust/` — Rust solutions\n\nFeel free to explore, learn, and discuss.\nContributions and suggestions are always welcome!\n\n---\n\n## Essential Algorithm Fundamentals\n\n### Algorithm Basics You Must Master:\n\n1. Linked List: traversal, reversal, merging, cycle detection\n2. Binary Tree: level order(max/min depth, symmetric tree), preorder/inorder/postorder traversal (both recursive and iterative), inversion, lowest common ancestor, merge two binary trees\n3. Sorting: quick sort, merge sort, insertion sort, selection sort, bubble sort, heap sort\n4. Binary Search: on sorted arrays, binary trees\n5. Bit Manipulation Techniques:\n   - XOR (`^`): find numbers that appear only once or twice.\n   - AND (\u0026):\n     - `n \u0026 (n-1)`: removes the lowest set bit, commonly used to check if a number is a power of 2.\n     - `n \u0026 -n`: gets the lowest set bit.\n   - `\u003c\u003c` and `\u003e\u003e`: efficient multiplication and division by 2.\n   - Use XOR to find the unique unpaired number.\n6. Math Techniques: fast exponentiation, [GCD/LCM](core/math/GCD\u0026LCM/README.md), [elementary math simulation](core/patterns/elementary_math_simulation/README.md)\n\n### Core Algorithm Ideas:\n\n1. Hash table: trading space for time\n2. Two pointers: fast/slow pointers, left/right pointers (collision pointers), sliding window\n3. DFS: using a stack\n4. BFS/backtracking: using a queue\n5. Dynamic Programming (DP)\n\n---\n\n## Must-Know Classic LeetCode Problems by Category\n\n1. Arrays \u0026 Strings\n\n- [1. Two Sum](https://leetcode.com/problems/two-sum/)\n- [121. Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/)\n- [189. Rotate Array](https://leetcode.com/problems/rotate-array/)\n- [217. Contains Duplicate](https://leetcode.com/problems/contains-duplicate/)\n- [238. Product of Array Except Self](https://leetcode.com/problems/product-of-array-except-self/)\n- [3. Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/)\n- [125. Valid Palindrome](https://leetcode.com/problems/valid-palindrome/)\n\n2. Linked Lists\n\n- [206. Reverse Linked List](https://leetcode.com/problems/reverse-linked-list/)\n- [21. Merge Two Sorted Lists](https://leetcode.com/problems/merge-two-sorted-lists/)\n- [141. Linked List Cycle](https://leetcode.com/problems/linked-list-cycle/)\n- [19. Remove Nth Node From End of List](https://leetcode.com/problems/remove-nth-node-from-end-of-list/)\n- [234. Palindrome Linked List](https://leetcode.com/problems/palindrome-linked-list/)\n\n3. Stacks \u0026 Queues\n\n- [20. Valid Parentheses](https://leetcode.com/problems/valid-parentheses/)\n- [155. Min Stack](https://leetcode.com/problems/min-stack/)\n- [739. Daily Temperatures](https://leetcode.com/problems/daily-temperatures/)\n- [232. Implement Queue using Stacks](https://leetcode.com/problems/implement-queue-using-stacks/)\n\n4. Hash Tables\n\n- [1. Two Sum](https://leetcode.com/problems/two-sum/)\n- [49. Group Anagrams](https://leetcode.com/problems/group-anagrams/)\n- [349. Intersection of Two Arrays](https://leetcode.com/problems/intersection-of-two-arrays/)\n- [146. LRU Cache](https://leetcode.com/problems/lru-cache/)\n\n5. Binary Search\n\n- [704. Binary Search](https://leetcode.com/problems/binary-search/)\n- [35. Search Insert Position](https://leetcode.com/problems/search-insert-position/)\n- [153. Find Minimum in Rotated Sorted Array](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/)\n- [33. Search in Rotated Sorted Array](https://leetcode.com/problems/search-in-rotated-sorted-array/)\n\n6. Dynamic Programming\n\n- [70. Climbing Stairs](https://leetcode.com/problems/climbing-stairs/)\n- [53. Maximum Subarray](https://leetcode.com/problems/maximum-subarray/)\n- [322. Coin Change](https://leetcode.com/problems/coin-change/)\n- [300. Longest Increasing Subsequence](https://leetcode.com/problems/longest-increasing-subsequence/)\n- [72. Edit Distance](https://leetcode.com/problems/edit-distance/)\n\n7. Backtracking\n\n- [78. Subsets](https://leetcode.com/problems/subsets/)\n- [46. Permutations](https://leetcode.com/problems/permutations/)\n- [39. Combination Sum](https://leetcode.com/problems/combination-sum/)\n- [79. Word Search](https://leetcode.com/problems/word-search/)\n\n8. Trees \u0026 Recursion\n\n- [104. Maximum Depth of Binary Tree](https://leetcode.com/problems/maximum-depth-of-binary-tree/)\n- [226. Invert Binary Tree](https://leetcode.com/problems/invert-binary-tree/)\n- [101. Symmetric Tree](https://leetcode.com/problems/symmetric-tree/)\n- [102. Binary Tree Level Order Traversal](https://leetcode.com/problems/binary-tree-level-order-traversal/)\n- [235. Lowest Common Ancestor of a BST](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/)\n\n9. Graphs (BFS \u0026 DFS)\n\n- [200. Number of Islands](https://leetcode.com/problems/number-of-islands/)\n- [133. Clone Graph](https://leetcode.com/problems/clone-graph/)\n- [207. Course Schedule](https://leetcode.com/problems/course-schedule/)\n- [127. Word Ladder](https://leetcode.com/problems/word-ladder/)\n\n10. Greedy Algorithms\n\n- [55. Jump Game](https://leetcode.com/problems/jump-game/)\n- [455. Assign Cookies](https://leetcode.com/problems/assign-cookies/)\n- [435. Non-overlapping Intervals](https://leetcode.com/problems/non-overlapping-intervals/)\n\n11. Math \u0026 Bit Manipulation\n\n- [231. Power of Two](https://leetcode.com/problems/power-of-two/)\n- [69. Sqrt(x)](https://leetcode.com/problems/sqrtx/)\n- [371. Sum of Two Integers](https://leetcode.com/problems/sum-of-two-integers/)\n\n---\n\n## Visualization Algorithm Tools\n\n- [Algorithm Visualizer](https://algorithm-visualizer.org/)\n- [VisuAlgo](https://visualgo.net/)\n\n## Algorithm Learning Resources\n\n- [Hello 算法](https://www.hello-algo.com/)\n- [Labuladong 的算法笔记](https://labuladong.online/algo/)\n- [代码随想录](https://programmercarl.com)\n\n## Todo List\n- [ ] 中英双语文档\n- [ ] 每个题目分析平均、最好、最坏时间复杂度\n- [ ] 每个题目分析不同解法的优缺点\n- [ ] 使用 Python 求解\n- [ ] 使用 Rust 求解\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpalemoky%2Fleetcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpalemoky%2Fleetcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpalemoky%2Fleetcode/lists"}