{"id":22941405,"url":"https://github.com/bashmocha/leetcode-solutions","last_synced_at":"2025-10-10T18:06:45.317Z","repository":{"id":187580125,"uuid":"570846033","full_name":"BashMocha/leetcode-solutions","owner":"BashMocha","description":"Solutions to Leetcode problems; updated daily","archived":false,"fork":false,"pushed_at":"2024-03-08T07:44:04.000Z","size":78,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-02T16:02:22.134Z","etag":null,"topics":["algorithms-and-data-structures","leetcode","leetcode-solutions","python3"],"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/BashMocha.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":"2022-11-26T10:18:10.000Z","updated_at":"2023-10-22T08:40:27.000Z","dependencies_parsed_at":"2023-08-11T07:01:14.961Z","dependency_job_id":"d8d1af56-ab42-47b7-bad3-90f7e0209768","html_url":"https://github.com/BashMocha/leetcode-solutions","commit_stats":null,"previous_names":["cheesyfrappe/data-structures-and-algorithms","cheesyfrappe/leetcode-solutions","bashmocha/leetcode-solutions"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BashMocha/leetcode-solutions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BashMocha%2Fleetcode-solutions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BashMocha%2Fleetcode-solutions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BashMocha%2Fleetcode-solutions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BashMocha%2Fleetcode-solutions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BashMocha","download_url":"https://codeload.github.com/BashMocha/leetcode-solutions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BashMocha%2Fleetcode-solutions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279004908,"owners_count":26083802,"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-10T02:00:06.843Z","response_time":62,"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-and-data-structures","leetcode","leetcode-solutions","python3"],"created_at":"2024-12-14T13:39:25.494Z","updated_at":"2025-10-10T18:06:45.301Z","avatar_url":"https://github.com/BashMocha.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Leetcode solutions\n\n\nSolutions to LeetCode problems done by [me](https://leetcode.com/CheesyFrappe/). All of the problems are done in Python3. \u003cbr\u003e\nYou can take a look at my [cheat sheet](https://docs.google.com/spreadsheets/d/1ynFoTR0QUidBiOjPXEDPs7hjLxxoR8kRZ3GejIKJf7E/edit?usp=sharing) that I take notes for each problem.\n\n![LeetCode Stats](https://leetcard.jacoblin.cool/CheesyFrappe?theme=unicorn\u0026font=Roboto\u0026ext=heatmap)\n\n---\n  \n| # | Title | Solution | Difficulty |\n|---| ----- | -------- | ---------- |\n|136|[Single Number](https://leetcode.com/problems/single-number/) | [Python](./python3/array/singleNumber.py)|Easy|\n|217|[Contains Duplicate](https://leetcode.com/problems/contains-duplicate/) | [Python](./python3/array/containsDuplicate.py)|Easy|\n|219|[Contains Duplicate II](https://leetcode.com/problems/contains-duplicate-ii/) | [Python](./python3/array/containsDuplicateII.py)|Easy|\n|118|[Pascal's Triangle](https://leetcode.com/problems/pascals-triangle/) | [Python](./python3/array/pascalsTriangle.py)|Easy|\n|119|[Pascal's Triangle II](https://leetcode.com/problems/pascals-triangle-ii/) | [Python](./python3/array/pascalsTriangleII.py)|Easy|\n|268|[Missing Number](https://leetcode.com/problems/missing-number/) | [Python](./python3/array/missingNumber.py)|Easy|\n|283|[Move Zeroes](https://leetcode.com/problems/move-zeroes/) | [Python](./python3/array/moveZeroes.py)|Easy|\n|349|[Intersection of Two Arrays](https://leetcode.com/problems/intersection-of-two-arrays/) | [Python](./python3/array/intersectionOfTwoArrays.py)|Easy|\n|343|[Integer Break](https://leetcode.com/problems/integer-break/) | [Python](./python3/dynamic%20programming/integerBreak.py)|Medium|\n|350|[Intersection of Two Arrays II](https://leetcode.com/problems/intersection-of-two-arrays-ii/) | [Python](./python3/array/intersectionOfTwoArraysII.py)|Easy|\n|414|[Third Maximum Number](https://leetcode.com/problems/third-maximum-number/) | [Python](./python3/array/thirdMaximumNumber.py)|Easy|\n|448|[Find All Numbers Disappeared in an Array](https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/) | [Python](./python3/array/findAllNumbersDisappearedInArray.py)|Easy|\n|34|[Find First and Last Position of Element in Sorted Array](https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/) | [Python](./python3/array/findFirstAndLastPosition.py)|Medium|\n|347|[Top K Frequent Elements](https://leetcode.com/problems/top-k-frequent-elements/) | [Python](./python3/array/topKFrequentElements.py)|Medium|\n|238|[Product of Arrat Except Self](https://leetcode.com/problems/product-of-array-except-self/) | [Python](./python3/array/productOfArrayExceptSelf.py)|Medium|\n|1929|[Concatenation Of Array](https://leetcode.com/problems/concatenation-of-array/) | [Python](./python3/array/concatenationOfArray.py)|Easy|\n|1876|[Substrings of Size Three with Distinct Characters](https://leetcode.com/problems/substrings-of-size-three-with-distinct-characters/) | [Python](./python3/array/substringsOfSizeThree.py)|Easy|\n|643|[Maximum Average Subarray I](https://leetcode.com/problems/maximum-average-subarray-i/) | [Python](./python3/array/maximumAverageSubarrayI.py)|Easy|\n|121|[Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/) | [Python](./python3/array/bestTimeToBuyAndSellStock.py)|Easy|\n|3|[Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters) | [Python](./python3/sliding%20window/longestSubstringWithoutRepeatingChars.py)|Medium|\n|125|[Valid Palindrome](https://leetcode.com/problems/valid-palindrome) | [Python](./python3/two%20pointers/validPalindrome.py)|Easy|\n|424|[Longest Repeating Character Replacement](https://leetcode.com/problems/longest-repeating-character-replacement) | [Python](./python3/sliding%20window/longestRepeatingCharReplacement.py)|Medium|\n|49|[Group Anagrams](https://leetcode.com/problems/group-anagrams) | [Python](./python3/hash%20map/groupAnagrams.py)|Medium|\n|128|[Group Anagrams](https://leetcode.com/problems/longest-consecutive-sequence) | [Python](./python3/array/longestConsecutiveSequence.py)|Medium| \n|88|[Merge Sorted Array](https://leetcode.com/problems/merge-sorted-array) | [Python](./python3/array/mergeSortedArray.py)|Easy| \n|20|[Valid Parentheses](https://leetcode.com/problems/valid-parentheses) | [Python](./python3/stack/validParentheses.py)|Easy| \n|155|[Min Stack](https://leetcode.com/problems/min-stack) | [Python](./python3/stack/minStack.py)|Medium| \n|150|[Evaluate Reverse Polish Notation](https://leetcode.com/problems/evaluate-reverse-polish-notation) | [Python](./python3/stack/evalRPN.py)|Medium| \n|255|[Implement Stack using Queues](https://leetcode.com/problems/implement-stack-using-queues) | [Python](./python3/stack/implementStackUsingQueues.py)|Easy| \n|22|[Generate Parentheses](https://leetcode.com/problems/generate-parentheses) | [Python](./python3/stack/generateParentheses.py)|Medium| \n|496|[Next Greater Element I](https://leetcode.com/problems/next-greater-element-i) | [Python](./python3/stack/nextGreaterElementI.py)|Easy|  \n|1475|[Final Prices With a Special Discount in a Shop](https://leetcode.com/problems/final-prices-with-a-special-discount-in-a-shop) | [Python](./python3/stack/FinalPricesWithDiscount.py)|Easy|  \n|94|[Binary Tree Inorder Traversal](https://leetcode.com/problems/binary-tree-inorder-traversal) | [Python](./python3/tree/inorderTraversal.py)|Easy|  \n|144|[Binary Tree Preorder Traversal](https://leetcode.com/problems/binary-tree-preorder-traversal) | [Python](./python3/tree/preorderTraversal.py)|Easy|  \n|145|[Binary Tree Postorder Traversal](https://leetcode.com/problems/binary-tree-postorder-traversal) | [Python](./python3/tree/postorderTraversal.py)|Easy|  \n|1913|[Maximum Product Difference Between Two Pairs](https://leetcode.com/problems/maximum-product-difference-between-two-pairs) | [Python](./python3/array/maxProductDifference.py)|Easy|  \n|100|[Same Tree](https://leetcode.com/problems/same-tree) | [Python](./python3/tree/sameTree.py)|Easy|  \n|102|[Binary Tree Level Order Traversal](https://leetcode.com/problems/binary-tree-level-order-traversal) | [Python](./python3/tree/levelOrderTraversal.py)|Medium|  \n|104|[Maximum Depth of Binary Tree](https://leetcode.com/problems/maximum-depth-of-binary-tree) | [Python](./python3/tree/maxDepthofBinaryTree.py)|Easy|  \n|101|[Symmetric Tree](https://leetcode.com/problems/symmetric-tree) | [Python](./python3/tree/symmetricTree.py)|Easy|  \n|226|[Invert Binary Tree](https://leetcode.com/problems/invert-binary-tree) | [Python](./python3/tree/invertBinaryTree.py)|Easy|  \n|108|[Convert Sorted Array to Binary Search Tree](https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree) | [Python](./python3/tree/convertSortedArrToTree.py)|Easy|  \n|344|[Reverse String](https://leetcode.com/problems/reverse-string) | [Python](./python3/string/reverseString.py)|Easy| \n|9|[Palindrome Number](https://leetcode.com/problems/palindrome-number) | [Python](./python3/math/palindromeNumber.py)|Easy| \n|222|[Count Complete Tree Nodes](https://leetcode.com/problems/count-complete-tree-nodes) | [Python](./python3/tree/countCompleteTreeNodes.py)|Easy| \n|257|[Binary Tree Paths](https://leetcode.com/problems/binary-tree-paths) | [Python](./python3/tree/binaryTreePaths.py)|Easy| \n|21|[Merge Two Sorted Lists](https://leetcode.com/problems/merge-two-sorted-lists) | [Python](./python3/linked%20list/mergeTwoSortedLists.py)|Easy| \n|112|[Path Sum](https://leetcode.com/problems/path-sum) | [Python](./python3/tree/pathSum.py)|Easy| \n|404|[Sum of Left Leaves](https://leetcode.com/problems/sum-of-left-leaves) | [Python](./python3/tree/sumOfLeftLeaves.py)|Easy| \n|645|[Set Mismatch](https://leetcode.com/problems/set-mismatch) | [Python](./python3/array/setMismatch.py)|Easy| \n|1108|[Defanging an IP Address](https://leetcode.com/problems/defanging-an-ip-address/) | [Python](./python3/string/defangeIPAddress.py)|Easy| \n|501|[Find Mode in Binary Search Tree](https://leetcode.com/problems/find-mode-in-binary-search-tree/) | [Python](./python3/tree/findModeinBST.py)|Easy| \n|530|[Minimum Difference in BST](https://leetcode.com/problems/minimum-absolute-difference-in-bst/) | [Python](./python3/tree/minAbsoluteDifference.py)|Easy| \n|1379|[Find a Corresponding Node of a Binary Tree in a Clone of That Tree](https://leetcode.com/problems/find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree/) | [Python](./python3/tree/findACorrespondingNode.py)|Easy| \n|543|[Diameter of Binary Tree](https://leetcode.com/problems/diameter-of-binary-tree/) | [Python](./python3/tree/diameterOfBinaryTree.py)|Easy| \n|617|[Merge Two Binary Trees](https://leetcode.com/problems/merge-two-binary-trees/) | [Python](./python3/tree/mergeTwoBinaryTrees.py)|Easy| \n|700|[Search in a Binary Search Tree](https://leetcode.com/problems/search-in-a-binary-search-tree/) | [Python](./python3/tree/searchInBST.py)|Easy| \n|232|[Implement Queue using Stacks](https://leetcode.com/problems/implement-queue-using-stacks/) | [Python](./python3/queue/implementQueueUsingStacks.py)|Easy| \n|637|[Average of Levels in Binary Tree](https://leetcode.com/problems/average-of-levels-in-binary-tree/) | [Python](./python3/tree/avgOfLevelsInTree.py)|Easy| \n|563|[Binary Tree Tilt](https://leetcode.com/problems/binary-tree-tilt/) | [Python](./python3/tree/binaryTreeTilt.py)|Easy| \n|653|[Two Sum IV - Input is a BST](https://leetcode.com/problems/two-sum-iv-input-is-a-bst/) | [Python](./python3/tree/twoSumIV.py)|Easy|\n|1791|[Find Center of Star Graph](https://leetcode.com/problems/find-center-of-star-graph/) | [Python](./python3/graph/findCenterOfStarGraph.py)|Easy|\n|1971|[Find if Path Exists in Graph](https://leetcode.com/problems/find-if-path-exists-in-graph/) | [Python](./python3/graph/findIfPathExists.py)|Easy|\n|997|[Find the Town Judge](https://leetcode.com/problems/find-the-town-judge/) | [Python](./python3/graph/findTheTownJudge.py)|Easy|\n|133|[Clone Graph](https://leetcode.com/problems/clone-graph) | [Python](./python3/graph/cloneGraph.py)|Easy|\n|207|[Course Schedule](https://leetcode.com/problems/course-schedule) | [Python](./python3/graph/courseSchedule.py)|Easy|\n|417|[Pacific Atlantic Water Flow](https://leetcode.com/problems/pacific-atlantic-water-flow) | [Python](./python3/graph/pacificAtlantic.py)|Easy|\n|200|[Number of Islands](https://leetcode.com/problems/number-of-islands) | [Python](./python3/graph/numberOfIslands.py)|Medium|\n|128|[Longest Consecutive Sequence](https://leetcode.com/problems/longest-consecutive-sequence) | [Python](./python3/graph/longestConsecutiveSequence.py)|Medium|\n|210|[Course Schedule II](https://leetcode.com/problems/course-schedule-ii) | [Python](./python3/graph/courseScheduleII.py)|Medium|\n|797|[All Paths From Source to Target](https://leetcode.com/problems/all-paths-from-source-to-target) | [Python](./python3/graph/allPaths.py)|Medium|\n|1557|[Minimum Number of Vertices to Reach All Nodes](https://leetcode.com/problems/minimum-number-of-vertices-to-reach-all-nodes) | [Python](./python3/graph/minNumberOfNodes.py)|Medium|\n|2642|[Design Graph With Shortest Path Calculator](https://leetcode.com/problems/design-graph-with-shortest-path-calculator/) | [Python](./python3/graph/designGraph.py)|Hard|\n|1470|[Shuffle the Array](https://leetcode.com/problems/shuffle-the-array) | [Python](./python3/array/shuffleTheArray.py)|Hard|\n|1203|[Sort Items by Groups Respecting Dependencies](https://leetcode.com/problems/sort-items-by-groups-respecting-dependencies) | [Python](./python3/graph/sortItemsByGroups.py)|Hard|\n|13|[Roman to Integer](https://leetcode.com/problems/roman-to-integer) | [Python](./python3/hash%20map/romanToInteger.py)|Easy|\n|1290|[Convert Binary Number in a Linked List to Integer](https://leetcode.com/problems/convert-binary-number-in-a-linked-list-to-integer/) | [Python](./python3/linked%20list/convBinaryNum.py)|Easy|\n|513|[Find Bottom Left Tree Value](https://leetcode.com/problems/find-bottom-left-tree-value) | [Python](./python3/tree/findBottomLeftTree.py)|Easy|\n|1609|[Even Odd Tree](https://leetcode.com/problems/even-odd-tree) | [Python](./python3/tree/evenOddTree.py)|Medium|\n|2864|[Maximum Odd Binary Number](https://leetcode.com/problems/maximum-odd-binary-number) | [Python](./python3/string/maxOddBinaryNumber.py)|Easy|\n|977|[Squares of a Sorted Array](https://leetcode.com/problems/squares-of-a-sorted-array) | [Python](./python3/array/squaresOfArr.py)|Easy|\n|19|[Remove Nth Node From End of List](https://leetcode.com/problems/remove-nth-node-from-end-of-list) | [Python](./python3/linked%20list/removeNthFromList.py)|Easy|\n|876|[Middle of the Linked List](https://leetcode.com/problems/middle-of-the-linked-list) | [Python](./python3/linked%20list/middleOfTheLinkedList.py)|Easy|\n|83|[Remove Duplicates from Sorted List](https://leetcode.com/problems/remove-duplicates-from-sorted-list) | [Python](./python3/linked%20list/removeDupelicatesFromList.py)|Easy|\n|141|[Linked List Cycle](https://leetcode.com/problems/linked-list-cycle) | [Python](./python3/linked%20list/linkedListCycle.py)|Easy|\n|3005|[Count Elements With Maximum Frequency](https://leetcode.com/problems/count-elements-with-maximum-frequency) | [Python](./python3/linked%20list/countElementsMaxFreq.py)|Easy|\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbashmocha%2Fleetcode-solutions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbashmocha%2Fleetcode-solutions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbashmocha%2Fleetcode-solutions/lists"}