{"id":20812095,"url":"https://github.com/jagrit007/lc-prac","last_synced_at":"2026-04-22T11:06:05.560Z","repository":{"id":218939718,"uuid":"747725344","full_name":"jagrit007/lc-prac","owner":"jagrit007","description":"🧑🏻‍💻 Repository for my saving my leetcode solutions [JAVA/PYTHON3]","archived":false,"fork":false,"pushed_at":"2024-07-15T16:57:19.000Z","size":230,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-26T22:49:00.417Z","etag":null,"topics":["leetcode","leetcode-python","leetcode-solutions"],"latest_commit_sha":null,"homepage":"","language":"Python","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/jagrit007.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}},"created_at":"2024-01-24T14:17:41.000Z","updated_at":"2024-07-15T16:57:22.000Z","dependencies_parsed_at":"2024-04-09T06:23:20.662Z","dependency_job_id":"c6a2b864-ae05-4851-a217-d13d76b4f08e","html_url":"https://github.com/jagrit007/lc-prac","commit_stats":null,"previous_names":["jagrit007/lc-prac"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jagrit007/lc-prac","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jagrit007%2Flc-prac","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jagrit007%2Flc-prac/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jagrit007%2Flc-prac/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jagrit007%2Flc-prac/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jagrit007","download_url":"https://codeload.github.com/jagrit007/lc-prac/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jagrit007%2Flc-prac/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32132976,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T08:34:57.708Z","status":"ssl_error","status_checked_at":"2026-04-22T08:34:55.583Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["leetcode","leetcode-python","leetcode-solutions"],"created_at":"2024-11-17T20:50:22.350Z","updated_at":"2026-04-22T11:06:05.400Z","avatar_url":"https://github.com/jagrit007.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Solved Problems 🧑🏻‍💻\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://docs.google.com/spreadsheets/d/e/2PACX-1vSxi0OLhvLXXwincqYhRS_AtAklQ9VE7LxVBJU92HVRez1q4bl66kdP_D4GcNf-LtPqZK7IRAfY3JoH/pubchart?oid=547935406\u0026format=image\" /\u003e\n\u003c/p\u003e\n\n| S.no. | Title                                             | Link                                                                                                                                                            | SolutionApproachUsed                              | DataStructuresUsed | Level(Hard/Med/Easy) |\n| ----- | ------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- | ------------------ | -------------------- |\n| 1     | Two Sum                                           | [two-sum.py](https://github.com/jagrit007/lc-prac/tree/main/1-two-sum)                                                                                          | Use hashmap for O(n) efficiency                   | Hash Map           | Easy                 |\n| 2     | Best Time to Buy and Sell Stock                   | [best-time-to-buy-and-sell-stock.py](https://github.com/jagrit007/lc-prac/tree/main/121-best-time-to-buy-and-sell-stock)                                        | Track min price and max profit                    | Array              | Easy                 |\n| 3     | Valid Palindrome                                  | [valid-palindrome.py](https://github.com/jagrit007/lc-prac/tree/main/125-valid-palindrome)                                                                      | Filter alphanumeric and check palindrome          | String             | Easy                 |\n| 4     | Longest Consecutive Sequence                      | [longest-consecutive-sequence.py](https://github.com/jagrit007/lc-prac/tree/main/128-longest-consecutive-sequence)                                              | Set to find sequences, then iterate               | Set                | Hard                 |\n| 5     | Minimum Garden Perimeter to Collect Enough Apples | [minimum-garden-perimeter-to-collect-enough-apples.java](https://github.com/jagrit007/lc-prac/tree/main/1295-minimum-garden-perimeter-to-collect-enough-apples) | Increment perimeter until apples met              | Math               | Medium               |\n| 6     | Single Number                                     | [single-number.py](https://github.com/jagrit007/lc-prac/tree/main/136-single-number)                                                                            | Bitwise XOR to isolate single number              | Bit Manipulation   | Easy                 |\n| 7     | Longest Common Prefix                             | [longest-common-prefix.py](https://github.com/jagrit007/lc-prac/tree/main/14-longest-common-prefix)                                                             | Sort and compare first and last strings           | Array              | Easy                 |\n| 8     | Two Sum II - Input Array Is Sorted                | [two-sum-ii-input-array-is-sorted.py](https://github.com/jagrit007/lc-prac/tree/main/167-two-sum-ii-input-array-is-sorted)                                      | Two pointers from ends to middle                  | Array              | Medium               |\n| 9     | Letter Combinations of a Phone Number             | [letter-combinations-of-a-phone-number.java](https://github.com/jagrit007/lc-prac/tree/main/17-letter-combinations-of-a-phone-number)                           | Recursive combination generation                  | String, Recursion  | Medium               |\n| 10    | Factorial Trailing Zeroes                         | [factorial-trailing-zeroes.py](https://github.com/jagrit007/lc-prac/tree/main/172-factorial-trailing-zeroes)                                                    | Count multiples of 5 in n!                        | Math               | Easy                 |\n| 11    | Remove Nth Node From End of List                  | [remove-nth-node-from-end-of-list.java](https://github.com/jagrit007/lc-prac/tree/main/19-remove-nth-node-from-end-of-list)                                     | Two pointers with n gap                           | Linked List        | Medium               |\n| 12    | Count Primes                                      | [count-primes.java](https://github.com/jagrit007/lc-prac/tree/main/204-count-primes)                                                                            | Sieve of Eratosthenes                             | Array              | Easy                 |\n| 13    | Kth Largest Element in an Array                   | [kth-largest-element-in-an-array.py](https://github.com/jagrit007/lc-prac/tree/main/215-kth-largest-element-in-an-array)                                        | Min-heap for top K elements                       | Heap               | Medium               |\n| 14    | Contains Duplicate                                | [contains-duplicate.py](https://github.com/jagrit007/lc-prac/tree/main/217-contains-duplicate)                                                                  | Hashset to track duplicates                       | Hash Set           | Easy                 |\n| 15    | Palindrome Linked List                            | [palindrome-linked-list.java](https://github.com/jagrit007/lc-prac/tree/main/234-palindrome-linked-list)                                                        | Convert to list and check palindrome              | Linked List        | Easy                 |\n| 16    | Product of Array Except Self                      | [product-of-array-except-self.py](https://github.com/jagrit007/lc-prac/tree/main/238-product-of-array-except-self)                                              | Left and right product lists                      | Array              | Medium               |\n| 17    | Valid Anagram                                     | [valid-anagram.py](https://github.com/jagrit007/lc-prac/tree/main/242-valid-anagram)                                                                            | Check if t is permutation of s                    | Hash Map           | Easy                 |\n| 18    | Missing Number                                    | [missing-number.py](https://github.com/jagrit007/lc-prac/tree/main/268-missing-number)                                                                          | Sort and find missing number                      | Math               | Easy                 |\n| 19    | Encode and Decode Strings                         | [encode-and-decode-strings.py](https://github.com/jagrit007/lc-prac/tree/main/271-encode-and-decode-strings)                                                    | Length header for each string                     | String             | Medium               |\n| 20    | Move Zeroes                                       | [move-zeroes.py](https://github.com/jagrit007/lc-prac/tree/main/283-move-zeroes)                                                                                | Two pointers to swap non-zero elements            | Array              | Easy                 |\n| 21    | Bulb Switcher                                     | [bulb-switcher.java](https://github.com/jagrit007/lc-prac/tree/main/319-bulb-switcher)                                                                          | Math.sqrt to find the switch count                | Math               | Medium               |\n| 22    | Top K Frequent Elements                           | [top-k-frequent-elements.py](https://github.com/jagrit007/lc-prac/tree/main/347-top-k-frequent-elements)                                                        | Heap to find top K frequent elements              | Heap               | Medium               |\n| 23    | Valid Sudoku                                      | [valid-sudoku.py](https://github.com/jagrit007/lc-prac/tree/main/36-valid-sudoku)                                                                               | Sets to check row, column, and box validity       | Hash Set           | Medium               |\n| 24    | Sudoku Solver                                     | [sudoku-solver.java](https://github.com/jagrit007/lc-prac/tree/main/37-sudoku-solver)                                                                           | Backtracking to solve the puzzle                  | Backtracking       | Hard                 |\n| 25    | Fizz Buzz                                         | [fizz-buzz.py](https://github.com/jagrit007/lc-prac/tree/main/412-fizz-buzz)                                                                                    | Iterate and check divisibility by 3 and 5         | Array              | Easy                 |\n| 26    | Trapping Rain Water                               | [trapping-rain-water.py](https://github.com/jagrit007/lc-prac/tree/main/42-trapping-rain-water)                                                                 | Two pointers to calculate trapped water           | Array              | Hard                 |\n| 27    | Group Anagrams                                    | [group-anagrams.py](https://github.com/jagrit007/lc-prac/tree/main/49-group-anagrams)                                                                           | Categorize by sorted string                       | Hash Map           | Medium               |\n| 28    | Pow(x, n)                                         | [powx-n.py](https://github.com/jagrit007/lc-prac/tree/main/50-powx-n)                                                                                           | Direct computation                                | Math               | Medium               |\n| 29    | N-Queens                                          | [n-queens.java](https://github.com/jagrit007/lc-prac/tree/main/51-n-queens)                                                                                     | Backtracking to place queens                      | Backtracking       | Hard                 |\n| 30    | Contiguous Array                                  | [contiguous-array.py](https://github.com/jagrit007/lc-prac/tree/main/525-contiguous-array)                                                                      | Hash map to track count balance                   | Hash Map           | Medium               |\n| 31    | Permutation in String                             | [permutation-in-string.py](https://github.com/jagrit007/lc-prac/tree/main/567-permutation-in-string)                                                            | Sliding window with character count               | Hash Map           | Medium               |\n| 32    | Reverse Integer                                   | [reverse-integer.py](https://github.com/jagrit007/lc-prac/tree/main/7-reverse-integer)                                                                          | Reverse digits of the integer                     | Math               | Easy                 |\n| 33    | Binary Search                                     | [binary-search.py](https://github.com/jagrit007/lc-prac/tree/main/792-binary-search)                                                                            | Binary search algorithm                           | Array              | Easy                 |\n| 34    | Palindrome Number                                 | [palindrome-number.py](https://github.com/jagrit007/lc-prac/tree/main/9-palindrome-number)                                                                      | Check if integer is palindrome without converting | Math               | Easy                 |\n| 35    | Linked List Cycle                                 | [linked-list-cycle.java](https://github.com/jagrit007/lc-prac/tree/main/141-linked-list-cycle)                                                                  | Fast and slow pointers to detect cycle            | Linked List        | Easy                 |\n| 36    | Min Stack                                         | [min-stack.java](https://github.com/jagrit007/lc-prac/blob/main/155-min-stack/min-stack.java)                                                                   | Design a stack that supports min in O(1) time     | Stack              | Easy                 |\n| 37    | Valid Parentheses                                 | [valid-parentheses.java](https://github.com/jagrit007/lc-prac/blob/main/20-valid-parentheses/valid-parentheses.java)                                            | Stack to check for balanced parentheses           | Stack              | Easy                 |\n| 38    | Merge Two Sorted Lists                            | [merge-two-sorted-lists.java](https://github.com/jagrit007/lc-prac/blob/main/21-merge-two-sorted-lists/merge-two-sorted-lists.java)                             | Merge two linked lists iteratively                | Linked List         | Easy                 |\n| 39    | Merge k Sorted Lists                              | [merge-k-sorted-lists.java](https://github.com/jagrit007/lc-prac/blob/main/23-merge-k-sorted-lists/merge-k-sorted-lists.java)                                   | Re-use mergeTwoLists code and DAQ approach        | Linked List, Heap   | Hard                 |\n| 40    | Assign Cookies                                    | [assign-cookies.py](https://github.com/jagrit007/lc-prac/blob/main/455-assign-cookies/assign-cookies.py)                                                        | Greedy to satisfy the most children               | Array, Greedy       | Easy                 |\n| 41    | Permutations                                      | [permutations.py](https://github.com/jagrit007/lc-prac/blob/main/46-permutations/permutations.py)                                                               | Backtracking                                      | Array, Backtracking | Medium               |\n| 42    | Image Smoother                                    | [image-smoother.py](https://github.com/jagrit007/lc-prac/blob/main/661-image-smoother/image-smoother.py)                                                        | Iterate and calculate average                     | Array               | Easy                 |\n| 43    | Combination Sum                                   | [combination-sum.py](https://github.com/jagrit007/lc-prac/blob/main/39-combination-sum/combination-sum.py)                                                      | Backtracking to find unique combinations          | Array, Backtracking | Medium               |\n| 44    | Word Search                                       | [word-search.py](https://github.com/jagrit007/lc-prac/blob/main/79-word-search/word-search.py)                                                                  | DFS to search words in a grid                     | Array, DFS          | Medium               |\n| 45    | Sort the Students by Their Kth Score              | [sort-the-students-by-their-kth-score.py](https://github.com/jagrit007/lc-prac/blob/main/2631-sort-the-students-by-their-kth-score/sort-the-students-by-their-kth-score.py) | Sorting based on criteria                         | Array                | Medium               |\n| 46    | Subsets                                           | [subsets.py](https://github.com/jagrit007/lc-prac/blob/main/78-subsets/subsets.py)                                                                                          | Backtracking to generate all subsets              | Array, Backtracking  | Medium               |\n| 47    | Custom Sort String                                | [custom-sort-string.py](https://github.com/jagrit007/lc-prac/blob/main/807-custom-sort-string/custom-sort-string.py)                                                        | Custom sorting logic                              | String, Hash Map     | Medium               |\n| 48    | Koko Eating Bananas                               | [koko-eating-bananas.py](https://github.com/jagrit007/lc-prac/blob/main/907-koko-eating-bananas/koko-eating-bananas.py)                                                     | Binary search to find the minimum speed           | Array, Binary Search | Medium               |\n| 49    | Palindrome Partitioning                           | [palindrome-partitioning.py](https://github.com/jagrit007/lc-prac/blob/main/131-palindrome-partitioning/palindrome-partitioning.py)                                         | Backtracking to find all possible palindrome partitioning                 | Array, Backtracking  | Medium               |\n| 50    | Evaluate Reverse Polish Notation                  | [evaluate-reverse-polish-notation.py](https://github.com/jagrit007/lc-prac/blob/main/150-evaluate-reverse-polish-notation/evaluate-reverse-polish-notation.py)              | Evaluate the value of an arithmetic expression in Reverse Polish Notation | Stack                | Medium               |\n| 51    | Generate Parentheses                              | [generate-parentheses.py](https://github.com/jagrit007/lc-prac/blob/main/22-generate-parentheses/generate-parentheses.py)                                                   | Backtracking to generate all combinations of well-formed parentheses      | String, Backtracking | Medium               |\n| 52    | Daily Temperatures                                | [daily-temperatures.py](https://github.com/jagrit007/lc-prac/blob/main/739-daily-temperatures/daily-temperatures.py)                                                        | Stack to find the next greater temperature                                | Array, Stack         | Medium               |\n| 53    | Car Fleet                                         | [car-fleet.py](https://github.com/jagrit007/lc-prac/blob/main/883-car-fleet/car-fleet.py)                                                                                   | Sorting and stack to calculate car fleets                                 | Array, Sorting       | Medium               |\n| 54 | Maximum 69 Number                                 | [maximum-69-number.py](https://github.com/jagrit007/lc-prac/blob/main/1448-maximum-69-number/maximum-69-number.py)                                                                                     | Greedy to maximize the number                                             | Math                 | Easy   |\n| 55 | Number of Employees Who Met the Target            | [number-of-employees-who-met-the-target.py](https://github.com/jagrit007/lc-prac/blob/main/2876-number-of-employees-who-met-the-target/number-of-employees-who-met-the-target.py)                      | Analyzing employee performance data                                       | Array                | Medium |\n| 56 | Longest Substring Without Repeating Characters    | [longest-substring-without-repeating-characters.py](https://github.com/jagrit007/lc-prac/blob/main/3-longest-substring-without-repeating-characters/longest-substring-without-repeating-characters.py) | Sliding window to find unique substring                                   | String, Hash Map     | Medium |\n| 57 | Split the Array                                   | [split-the-array.py](https://github.com/jagrit007/lc-prac/blob/main/3324-split-the-array/split-the-array.py)                                                                                           | Divide array into segments                                                | Array, Greedy        | Medium |\n| 58 | Longest Repeating Character Replacement           | [longest-repeating-character-replacement.py](https://github.com/jagrit007/lc-prac/blob/main/424-longest-repeating-character-replacement/longest-repeating-character-replacement.py)                    | Sliding window with character count                                       | String, Hash Map     | Medium |\n| 59 | Minimum Window Substring                          | [minimum-window-substring.py](https://github.com/jagrit007/lc-prac/blob/main/76-minimum-window-substring/minimum-window-substring.py)                                                                  | Sliding window to cover all characters                                    | String, Hash Map     | Hard   |\n| 60    | Longest Common Subsequence                        | [longest-common-subsequence.py](https://github.com/jagrit007/lc-prac/blob/main/1250-longest-common-subsequence/longest-common-subsequence.py)                                                          | Dynamic programming to find subsequence                                   | Array, DP            | Medium               |\n| 61    | Climbing Stairs                                   | [climbing-stairs.py](https://github.com/jagrit007/lc-prac/blob/main/70-climbing-stairs/climbing-stairs.py)                                                                                             | Dynamic programming for step combinations                                 | Math, DP             | Easy                 |\n| 62    | Word Break                                        | [word-break.py](https://github.com/jagrit007/lc-prac/blob/main/139-word-break/word-break.py)                                                                                                           | DP to check word segmentation possibilities                               | String, DP           | Medium               |\n| 63    | Longest Increasing Subsequence                    | [longest-increasing-subsequence.py](https://github.com/jagrit007/lc-prac/blob/main/300-longest-increasing-subsequence/longest-increasing-subsequence.py)                                               | DP for increasing subsequences                                            | Array, DP            | Medium               |\n| 64    | Number of 1 Bits                                  | [number-of-1-bits.py](https://github.com/jagrit007/lc-prac/blob/main/191-number-of-1-bits/number-of-1-bits.py)                                                                                         | Bit manipulation to count set bits                                        | Bit Manipulation     | Easy                 |\n| 65    | Largest Rectangle in Histogram                    | [largest-rectangle-in-histogram.py](https://github.com/jagrit007/lc-prac/blob/main/84-largest-rectangle-in-histogram/largest-rectangle-in-histogram.py)                                                | Stack to find largest rectangle area                                      | Array, Stack         | Hard                 |\n| 66    | Sliding Window Maximum                            | [sliding-window-maximum.py](https://github.com/jagrit007/lc-prac/blob/main/239-sliding-window-maximum/sliding-window-maximum.py)                                                                       | Deque for maximum in sliding window                                       | Array, Deque         | Hard                 |\n| 67    | Length of Last Word                               | [length-of-last-word.py](https://github.com/jagrit007/lc-prac/blob/main/58-length-of-last-word/length-of-last-word.py)                                                                                 | Iteration and String Manipulation                                         | String               | Easy                 |\n---\n[**View on Google Sheets**](https://bit.ly/j4grit-lc)\n\n~~*I am aware that links are broken as of now*~~ [FIXED] ✅\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjagrit007%2Flc-prac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjagrit007%2Flc-prac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjagrit007%2Flc-prac/lists"}