{"id":34674788,"url":"https://github.com/aliataf/leetcode-solutions","last_synced_at":"2025-12-24T20:19:33.590Z","repository":{"id":326144759,"uuid":"1104148083","full_name":"aliataf/leetcode-solutions","owner":"aliataf","description":"📚 LeetCode solutions in C++ with detailed explanations and complexity analysis","archived":false,"fork":false,"pushed_at":"2025-12-18T21:50:51.000Z","size":154,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-21T22:29:02.526Z","etag":null,"topics":["cplusplus","leetcode","problem-solving"],"latest_commit_sha":null,"homepage":"https://leetcode.com/u/aliataf/","language":"C++","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/aliataf.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":"2025-11-25T20:26:16.000Z","updated_at":"2025-12-18T21:50:54.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/aliataf/leetcode-solutions","commit_stats":null,"previous_names":["aliataf/leetcode-solutions"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aliataf/leetcode-solutions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliataf%2Fleetcode-solutions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliataf%2Fleetcode-solutions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliataf%2Fleetcode-solutions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliataf%2Fleetcode-solutions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aliataf","download_url":"https://codeload.github.com/aliataf/leetcode-solutions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliataf%2Fleetcode-solutions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28007870,"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-24T02:00:07.193Z","response_time":83,"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":["cplusplus","leetcode","problem-solving"],"created_at":"2025-12-24T20:19:33.059Z","updated_at":"2025-12-24T20:19:33.579Z","avatar_url":"https://github.com/aliataf.png","language":"C++","readme":"# 🧠 LeetCode Solutions\n\n[![LeetCode](https://img.shields.io/badge/LeetCode-000000?style=for-the-badge\u0026logo=LeetCode\u0026logoColor=#d16c06)](https://leetcode.com/)\n[![C++](https://img.shields.io/badge/C++-00599C?style=for-the-badge\u0026logo=cplusplus\u0026logoColor=white)](https://isocpp.org/)\n\nMy solutions to LeetCode problems, organized by topic and difficulty. Each solution includes detailed explanations, time \u0026 space complexity analysis, and multiple approaches when applicable.\n\n## 📊 Progress\n\n| Difficulty | Solved |\n|------------|--------|\n| 🟢 Easy    | 24     |\n| 🟡 Medium  | 29     |\n| 🔴 Hard    | 5      |\n| **Total**  | **58** |\n\n## 📁 Repository Structure\n\n```\nleetcode-solutions/\n├── arrays/\n├── backtracking/\n├── binary-search/\n├── dynamic-programming/\n├── graphs/\n├── greedy/\n├── heap/\n├── linked-lists/\n├── math/\n├── misc/\n├── sliding-window/\n├── stack-queue/\n├── strings/\n├── trees/\n└── two-pointers/\n```\n\n## 🗂️ Solutions by Topic\n\n### Arrays\n| # | Title | Difficulty | Solution |\n|---|-------|------------|----------|\n| 1 | [Two Sum](https://leetcode.com/problems/two-sum/) | 🟢 Easy | [C++](arrays/0001_two_sum.cpp) |\n| 15 | [3Sum](https://leetcode.com/problems/3sum/) | 🟡 Medium | [C++](arrays/0015_3sum.cpp) |\n| 26 | [Remove Duplicates from Sorted Array](https://leetcode.com/problems/remove-duplicates-from-sorted-array/) | 🟢 Easy | [C++](arrays/0026_remove_duplicates_from_sorted_array.cpp) |\n| 27 | [Remove Element](https://leetcode.com/problems/remove-element/) | 🟢 Easy | [C++](arrays/0027_remove_element.cpp) |\n| 36 | [Valid Sudoku](https://leetcode.com/problems/valid-sudoku/) | 🟡 Medium | [C++](arrays/0036_valid_sudoku.cpp) |\n| 54 | [Spiral Matrix](https://leetcode.com/problems/spiral-matrix/) | 🟡 Medium | [C++](arrays/0054_spiral_matrix.cpp) |\n| 88 | [Merge Sorted Array](https://leetcode.com/problems/merge-sorted-array/) | 🟢 Easy | [C++](arrays/0088_merge_sorted_array.cpp) |\n| 128 | [Longest Consecutive Sequence](https://leetcode.com/problems/longest-consecutive-sequence/) | 🟡 Medium | [C++](arrays/0128_longest_consecutive_sequence.cpp) |\n| 1991 | [Find the Middle Index in Array](https://leetcode.com/problems/find-the-middle-index-in-array/) | 🟢 Easy | [C++](arrays/1991_find_the_middle_index_in_array.cpp) |\n\n### Backtracking\n| # | Title | Difficulty | Solution |\n|---|-------|------------|----------|\n| 17 | [Letter Combinations of a Phone Number](https://leetcode.com/problems/letter-combinations-of-a-phone-number/) | 🟡 Medium | [C++](backtracking/0017_letter_combinations_of_a_phone_number.cpp) |\n| 22 | [Generate Parentheses](https://leetcode.com/problems/generate-parentheses/) | 🟡 Medium | [C++](backtracking/0022_generate_parentheses.cpp) |\n\n### Binary Search\n| # | Title | Difficulty | Solution |\n|---|-------|------------|----------|\n| 4 | [Median of Two Sorted Arrays](https://leetcode.com/problems/median-of-two-sorted-arrays/) | � Hard | [C++](binary-search/0004_median_of_two_sorted_arrays.cpp) |\n| 35 | [Search Insert Position](https://leetcode.com/problems/search-insert-position/) | � Easy | [C++](binary-search/0035_search_insert_position.cpp) |\n| 74 | [Search a 2D Matrix](https://leetcode.com/problems/search-a-2d-matrix/) | � Medium | [C++](binary-search/0074_search_a_2d_matrix.cpp) |\n\n### Dynamic Programming\n| # | Title | Difficulty | Solution |\n|---|-------|------------|----------|\n| 10 | [Regular Expression Matching](https://leetcode.com/problems/regular-expression-matching/) | 🔴 Hard | [C++](dynamic-programming/0010_regular_expression_matching.cpp) |\n| 5 | [Longest Palindromic Substring](https://leetcode.com/problems/longest-palindromic-substring/) | 🟡 Medium | [C++](dynamic-programming/0005_longest_palindromic_substring.cpp) |\n| 62 | [Unique Paths](https://leetcode.com/problems/unique-paths/) | � Medium | [C++](dynamic-programming/0062_unique_paths.cpp) |\n| 63 | [Unique Paths II](https://leetcode.com/problems/unique-paths-ii/) | � Medium | [C++](dynamic-programming/0063_unique_paths_ii.cpp) |\n| 64 | [Minimum Path Sum](https://leetcode.com/problems/minimum-path-sum/) | � Medium | [C++](dynamic-programming/0064_minimum_path_sum.cpp) |\n| 70 | [Climbing Stairs](https://leetcode.com/problems/climbing-stairs/) | 🟢 Easy | [C++](dynamic-programming/0070_climbing_stairs.cpp) |\n| 72 | [Edit Distance](https://leetcode.com/problems/edit-distance/) | � Medium | [C++](dynamic-programming/0072_edit_distance.cpp) |\n| 118 | [Pascal's Triangle](https://leetcode.com/problems/pascals-triangle/) | 🟢 Easy | [C++](dynamic-programming/0118_pascals_triangle.cpp) |\n| 119 | [Pascal's Triangle II](https://leetcode.com/problems/pascals-triangle-ii/) | 🟢 Easy | [C++](dynamic-programming/0119_pascals_triangle_ii.cpp) |\n| 139 | [Word Break](https://leetcode.com/problems/word-break/) | 🟡 Medium | [C++](dynamic-programming/0139_word_break.cpp) |\n\n### Graphs\n| # | Title | Difficulty | Solution |\n|---|-------|------------|----------|\n| 133 | [Clone Graph](https://leetcode.com/problems/clone-graph/) | 🟡 Medium | [C++](graphs/0133_clone_graph.cpp) |\n| 207 | [Course Schedule](https://leetcode.com/problems/course-schedule/) | 🟡 Medium | [C++](graphs/0207_course_schedule.cpp) |\n| 210 | [Course Schedule II](https://leetcode.com/problems/course-schedule-ii/) | 🟡 Medium | [C++](graphs/0210_course_schedule_ii.cpp) |\n| 997 | [Find the Town Judge](https://leetcode.com/problems/find-the-town-judge/) | 🟢 Easy | [C++](graphs/0997_find_the_town_judge.cpp) |\n\n### Greedy\n| # | Title | Difficulty | Solution |\n|---|-------|------------|----------|\n| 45 | [Jump Game II](https://leetcode.com/problems/jump-game-ii/) | 🟡 Medium | [C++](greedy/0045_jump_game_ii.cpp) |\n| 55 | [Jump Game](https://leetcode.com/problems/jump-game/) | 🟡 Medium | [C++](greedy/0055_jump_game.cpp) |\n| 121 | [Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/) | � Easy | [C++](greedy/0121_best_time_to_buy_and_sell_stock.cpp) |\n| 122 | [Best Time to Buy and Sell Stock II](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/) | 🟡 Medium | [C++](greedy/0122_best_time_to_buy_and_sell_stock_ii.cpp) |\n\n### Heap / Priority Queue\n| # | Title | Difficulty | Solution |\n|---|-------|------------|----------|\n| - | - | - | - |\n\n### Linked Lists\n| # | Title | Difficulty | Solution |\n|---|-------|------------|----------|\n| 2 | [Add Two Numbers](https://leetcode.com/problems/add-two-numbers/) | 🟡 Medium | [C++](linked-lists/0002_add_two_numbers.cpp) |\n| 21 | [Merge Two Sorted Lists](https://leetcode.com/problems/merge-two-sorted-lists/) | 🟢 Easy | [C++](linked-lists/0021_merge_two_sorted_lists.cpp) |\n| 83 | [Remove Duplicates from Sorted List](https://leetcode.com/problems/remove-duplicates-from-sorted-list/) | 🟢 Easy | [C++](linked-lists/0083_remove_duplicates_from_sorted_list.cpp) |\n| 141 | [Linked List Cycle](https://leetcode.com/problems/linked-list-cycle/) | � Easy | [C++](linked-lists/0141_linked_list_cycle.cpp) |\n\n### Math\n| # | Title | Difficulty | Solution |\n|---|-------|------------|----------|\n| 7 | [Reverse Integer](https://leetcode.com/problems/reverse-integer/) | � Medium | [C++](math/0007_reverse_integer.cpp) |\n| 9 | [Palindrome Number](https://leetcode.com/problems/palindrome-number/) | 🟢 Easy | [C++](math/0009_palindrome_number.cpp) |\n| 12 | [Integer to Roman](https://leetcode.com/problems/integer-to-roman/) | 🟡 Medium | [C++](math/0012_integer_to_roman.cpp) |\n| 13 | [Roman to Integer](https://leetcode.com/problems/roman-to-integer/) | 🟢 Easy | [C++](math/0013_roman_to_integer.cpp) |\n| 66 | [Plus One](https://leetcode.com/problems/plus-one/) | 🟢 Easy | [C++](math/0066_plus_one.cpp) |\n| 67 | [Add Binary](https://leetcode.com/problems/add-binary/) | � Easy | [C++](math/0067_add_binary.cpp) |\n| 69 | [Sqrt(x)](https://leetcode.com/problems/sqrtx/) | 🟢 Easy | [C++](math/0069_sqrt_x.cpp) |\n| 136 | [Single Number](https://leetcode.com/problems/single-number/) | � Easy | [C++](math/0136_single_number.cpp) |\n| 137 | [Single Number II](https://leetcode.com/problems/single-number-ii/) | � Medium | [C++](math/0137_single_number_ii.cpp) |\n\n### Sliding Window\n| # | Title | Difficulty | Solution |\n|---|-------|------------|----------|\n| 3 | [Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/) | 🟡 Medium | [C++](sliding-window/0003_longest_substring_without_repeating_characters.cpp) |\n| 76 | [Minimum Window Substring](https://leetcode.com/problems/minimum-window-substring/) | 🔴 Hard | [C++](sliding-window/0076_minimum_window_substring.cpp) |\n\n### Stack \u0026 Queue\n| # | Title | Difficulty | Solution |\n|---|-------|------------|----------|\n| 20 | [Valid Parentheses](https://leetcode.com/problems/valid-parentheses/) | 🟢 Easy | [C++](stack-queue/0020_valid_parentheses.cpp) |\n| 84 | [Largest Rectangle in Histogram](https://leetcode.com/problems/largest-rectangle-in-histogram/) | 🔴 Hard | [C++](stack-queue/0084_largest_rectangle_in_histogram.cpp) |\n\n### Strings\n| # | Title | Difficulty | Solution |\n|---|-------|------------|----------|\n| 6 | [Zigzag Conversion](https://leetcode.com/problems/zigzag-conversion/) | 🟡 Medium | [C++](strings/0006_zigzag_conversion.cpp) |\n| 8 | [String to Integer (atoi)](https://leetcode.com/problems/string-to-integer-atoi/) | 🟡 Medium | [C++](strings/0008_string_to_integer_atoi.cpp) |\n| 14 | [Longest Common Prefix](https://leetcode.com/problems/longest-common-prefix/) | � Easy | [C++](strings/0014_longest_common_prefix.cpp) |\n| 28 | [Find the Index of the First Occurrence in a String](https://leetcode.com/problems/find-the-index-of-the-first-occurrence-in-a-string/) | � Easy | [C++](strings/0028_find_index_of_first_occurrence.cpp) |\n| 49 | [Group Anagrams](https://leetcode.com/problems/group-anagrams/) | � Medium | [C++](strings/0049_group_anagrams.cpp) |\n| 58 | [Length of Last Word](https://leetcode.com/problems/length-of-last-word/) | � Easy | [C++](strings/0058_length_of_last_word.cpp) |\n\n### Trees\n| # | Title | Difficulty | Solution |\n|---|-------|------------|----------|\n| 94 | [Binary Tree Inorder Traversal](https://leetcode.com/problems/binary-tree-inorder-traversal/) | � Easy | [C++](trees/0094_binary_tree_inorder_traversal.cpp) |\n| 100 | [Same Tree](https://leetcode.com/problems/same-tree/) | 🟢 Easy | [C++](trees/0100_same_tree.cpp) |\n| 112 | [Path Sum](https://leetcode.com/problems/path-sum/) | 🟢 Easy | [C++](trees/0112_path_sum.cpp) |\n| 113 | [Path Sum II](https://leetcode.com/problems/path-sum-ii/) | 🟡 Medium | [C++](trees/0113_path_sum_ii.cpp) |\n\n### Two Pointers\n| # | Title | Difficulty | Solution |\n|---|-------|------------|----------|\n| 11 | [Container With Most Water](https://leetcode.com/problems/container-with-most-water/) | 🟡 Medium | [C++](two-pointers/0011_container_with_most_water.cpp) |\n| 42 | [Trapping Rain Water](https://leetcode.com/problems/trapping-rain-water/) | 🔴 Hard | [C++](two-pointers/0042_trapping_rain_water.cpp) |\n| 75 | [Sort Colors](https://leetcode.com/problems/sort-colors/) | 🟡 Medium | [C++](two-pointers/0075_sort_colors.cpp) |\n| 125 | [Valid Palindrome](https://leetcode.com/problems/valid-palindrome/) | 🟢 Easy | [C++](two-pointers/0125_valid_palindrome.cpp) |\n\n## 📝 Solution Template\n\nEach solution file follows this structure:\n- Problem description and link\n- Approach explanation\n- Time \u0026 Space complexity analysis\n- Clean, commented code\n- Test cases (when helpful)\n\n## 🚀 How to Use\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/aliataf/leetcode-solutions.git\n   ```\n\n2. Navigate to a topic folder and explore solutions\n\n3. Compile and run a solution:\n   ```bash\n   g++ -std=c++17 -o solution arrays/0001_two_sum.cpp \u0026\u0026 ./solution\n   ```\n\n## 🎯 Goals\n\n- [ ] Solve 100 Easy problems\n- [ ] Solve 150 Medium problems  \n- [ ] Solve 50 Hard problems\n- [ ] Complete all Blind 75 problems\n- [ ] Complete all NeetCode 150 problems\n\n## 📚 Resources\n\n- [LeetCode](https://leetcode.com/)\n- [NeetCode](https://neetcode.io/)\n- [Blind 75](https://leetcode.com/discuss/general-discussion/460599/blind-75-leetcode-questions)\n\n---\n\n⭐ Star this repo if you find it helpful!\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliataf%2Fleetcode-solutions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faliataf%2Fleetcode-solutions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliataf%2Fleetcode-solutions/lists"}