{"id":20272758,"url":"https://github.com/rajput-hemant/leetcode","last_synced_at":"2025-10-20T06:49:04.497Z","repository":{"id":51000717,"uuid":"519697475","full_name":"rajput-hemant/leetcode","owner":"rajput-hemant","description":"🏆 Curated solutions to Leetcode problems in multiple languages to ace the Coding Interviews.","archived":false,"fork":false,"pushed_at":"2024-04-11T12:55:28.000Z","size":14418,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T04:42:25.916Z","etag":null,"topics":["algorithm","algorithms","coding-interviews","data-structures","interview-questions","leetcode","leetcode-cpp","leetcode-go","leetcode-golang","leetcode-java","leetcode-python","leetcode-rust","leetcode-solutions","rust","rust-lang"],"latest_commit_sha":null,"homepage":"https://rajput-hemant.github.io/leetcode/","language":"Java","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/rajput-hemant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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-07-31T06:27:12.000Z","updated_at":"2025-04-09T14:47:09.000Z","dependencies_parsed_at":"2024-11-14T12:50:17.816Z","dependency_job_id":"695514d1-303c-49ba-b4a7-a929fb10f30d","html_url":"https://github.com/rajput-hemant/leetcode","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajput-hemant%2Fleetcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajput-hemant%2Fleetcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajput-hemant%2Fleetcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajput-hemant%2Fleetcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rajput-hemant","download_url":"https://codeload.github.com/rajput-hemant/leetcode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248345281,"owners_count":21088242,"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","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":["algorithm","algorithms","coding-interviews","data-structures","interview-questions","leetcode","leetcode-cpp","leetcode-go","leetcode-golang","leetcode-java","leetcode-python","leetcode-rust","leetcode-solutions","rust","rust-lang"],"created_at":"2024-11-14T12:46:44.021Z","updated_at":"2025-10-20T06:48:59.461Z","avatar_url":"https://github.com/rajput-hemant.png","language":"Java","readme":"\u003cdiv align=\"center\"\u003e\n\n\u003c!-- labels --\u003e\n\n[![][code-quality]][codacy] [![][active-issues]][deepsource] [![][resolved-issues]][deepsource]\n\n![][views] ![][stars] ![][forks] ![][issues] ![][license] ![][code-size] ![][commit-activity]\n\n\u003c!-- title/logo --\u003e\n\n\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"docs/public/light.png\"\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"docs/public/dark.png\"\u003e\n  \u003cimg alt=\"Leetcode\"\u003e\n\u003c/picture\u003e\n\n### 🏆 Curated solutions to Leetcode problems in multiple languages to ace the Coding Interviews.\n\n## Solutions\n\n---\n\n[\u003ckbd\u003e \u003cbr\u003e **Topic Wise** \u003cbr\u003e \u003c/kbd\u003e][topicwise] \u0026nbsp;\u0026nbsp;\n[\u003ckbd\u003e \u003cbr\u003e **Serial Wise** \u003cbr\u003e \u003c/kbd\u003e][serialwise]\n\n[**_Array_**][array] \u0026nbsp;•\u0026nbsp;\n[**_String_**][string] \u0026nbsp;•\u0026nbsp;\n[**_Hash Table_**][hash table] \u0026nbsp;•\u0026nbsp;\n[**_Dynamic Programming_**][dynamic programming] \u0026nbsp;•\u0026nbsp;\n[**_Math_**][math] \u0026nbsp;•\u0026nbsp;\n[**_Sorting_**][sorting] \u0026nbsp;•\u0026nbsp;\n[**_Greedy_**][greedy] \u0026nbsp;•\u0026nbsp;\n[**_DepthFirst Search_**][depth-first search] \u0026nbsp;•\u0026nbsp;\n[**_Database_**][database] \u0026nbsp;•\u0026nbsp;\n[**_BreadthFirst Search_**][breadth-first search] \u0026nbsp;•\u0026nbsp;\n[**_Tree_**][tree] \u0026nbsp;•\u0026nbsp;\n[**_Binary Search_**][binary search] \u0026nbsp;•\u0026nbsp;\n[**_Matrix_**][matrix] \u0026nbsp;•\u0026nbsp;\n[**_Binary Tree_**][binary tree] \u0026nbsp;•\u0026nbsp;\n[**_Two Pointers_**][two pointers] \u0026nbsp;•\u0026nbsp;\n[**_Bit Manipulation_**][bit manipulation] \u0026nbsp;•\u0026nbsp;\n[**_Stack_**][stack] \u0026nbsp;•\u0026nbsp;\n[**_Heap (Priority Queue)_**][heap] \u0026nbsp;•\u0026nbsp;\n[**_Design_**][design] \u0026nbsp;•\u0026nbsp;\n[**_Graph_**][graph] \u0026nbsp;•\u0026nbsp;\n[**_Prefix Sum_**][prefix sum] \u0026nbsp;•\u0026nbsp;\n[**_Simulation_**][simulation] \u0026nbsp;•\u0026nbsp;\n[**_Backtracking_**][backtracking] \u0026nbsp;•\u0026nbsp;\n[**_Counting_**][counting] \u0026nbsp;•\u0026nbsp;\n[**_Sliding Window_**][sliding window] \u0026nbsp;•\u0026nbsp;\n[**_Union Find_**][union find] \u0026nbsp;•\u0026nbsp;\n[**_Linked List_**][linked list] \u0026nbsp;•\u0026nbsp;\n[**_Ordered Set_**][ordered set] \u0026nbsp;•\u0026nbsp;\n[**_Monotonic Stack_**][monotonic stack] \u0026nbsp;•\u0026nbsp;\n[**_Enumeration_**][enumeration] \u0026nbsp;•\u0026nbsp;\n[**_Recursion_**][recursion] \u0026nbsp;•\u0026nbsp;\n[**_Trie_**][trie] \u0026nbsp;•\u0026nbsp;\n[**_Divide and Conquer_**][divide and conquer] \u0026nbsp;•\u0026nbsp;\n[**_Binary Search Tree_**][binary search tree] \u0026nbsp;•\u0026nbsp;\n[**_Bitmask_**][bitmask] \u0026nbsp;•\u0026nbsp;\n[**_Queue_**][queue] \u0026nbsp;•\u0026nbsp;\n[**_Memoization_**][memoization] \u0026nbsp;•\u0026nbsp;\n[**_Topological Sort_**][topological sort] \u0026nbsp;•\u0026nbsp;\n[**_Geometry_**][geometry] \u0026nbsp;•\u0026nbsp;\n[**_Segment Tree_**][segment tree] \u0026nbsp;•\u0026nbsp;\n[**_Hash Function_**][hash function] \u0026nbsp;•\u0026nbsp;\n[**_Game Theory_**][game theory] \u0026nbsp;•\u0026nbsp;\n[**_Binary Indexed Tree_**][binary indexed tree] \u0026nbsp;•\u0026nbsp;\n[**_Number Theory_**][number theory] \u0026nbsp;•\u0026nbsp;\n[**_Interactive_**][interactive] \u0026nbsp;•\u0026nbsp;\n[**_String Matching_**][string matching] \u0026nbsp;•\u0026nbsp;\n[**_Rolling Hash_**][rolling hash] \u0026nbsp;•\u0026nbsp;\n[**_Data Stream_**][data stream] \u0026nbsp;•\u0026nbsp;\n[**_Shortest Path_**][shortest path] \u0026nbsp;•\u0026nbsp;\n[**_Combinatorics_**][combinatorics] \u0026nbsp;•\u0026nbsp;\n[**_Randomized_**][randomized] \u0026nbsp;•\u0026nbsp;\n[**_Monotonic Queue_**][monotonic queue] \u0026nbsp;•\u0026nbsp;\n[**_Brainteaser_**][brainteaser] \u0026nbsp;•\u0026nbsp;\n[**_Merge Sort_**][merge sort] \u0026nbsp;•\u0026nbsp;\n[**_Iterator_**][iterator] \u0026nbsp;•\u0026nbsp;\n[**_Concurrency_**][concurrency] \u0026nbsp;•\u0026nbsp;\n[**_DoublyLinked List_**][doubly-linked list] \u0026nbsp;•\u0026nbsp;\n[**_Probability and Statistics_**][probability and statistics] \u0026nbsp;•\u0026nbsp;\n[**_Quickselect_**][quickselect] \u0026nbsp;•\u0026nbsp;\n[**_Bucket Sort_**][bucket sort] \u0026nbsp;•\u0026nbsp;\n[**_Suffix Array_**][suffix array] \u0026nbsp;•\u0026nbsp;\n[**_Minimum Spanning Tree_**][minimum spanning tree] \u0026nbsp;•\u0026nbsp;\n[**_Counting Sort_**][counting sort] \u0026nbsp;•\u0026nbsp;\n[**_Shell_**][shell] \u0026nbsp;•\u0026nbsp;\n[**_Line Sweep_**][line sweep] \u0026nbsp;•\u0026nbsp;\n[**_Reservoir Sampling_**][reservoir sampling] \u0026nbsp;•\u0026nbsp;\n[**_Eulerian Circuit_**][eulerian circuit] \u0026nbsp;•\u0026nbsp;\n[**_Radix Sort_**][radix sort] \u0026nbsp;•\u0026nbsp;\n[**_Strongly Connected Component_**][strongly connected component] \u0026nbsp;•\u0026nbsp;\n[**_Rejection Sampling_**][rejection sampling] \u0026nbsp;•\u0026nbsp;\n[**_Biconnected Component_**][biconnected component]\n\n### **Total Problems Solved: _193_**\n\n---\n\n## Contributions\n\n\u003c/div\u003e\n\n- Fork [this repository][leetcode] to your own GitHub account and then clone it to your local machine.\n- Checkout a new branch.\n- Make some changes to your leetcode repository, then push the changes to your remote GitHub repository.\n- Create a pull request with your changes!\n- See [CONTRIBUTING](./CONTRIBUTING.md) or [GitHub Help](https://help.github.com/en) for more details.\n\n```mermaid\n  graph TD;\n      A[rajput-hemant/leetcode] --1--\u003e B[create a fork \u003cbr\u003e your-username/leetcode];\n      B --2--\u003e C[clone your fork to your local machine];\n      C --3--\u003e D[checkout new branch, \u003cbr\u003eupdate or add your solution in relevant folder];\n      D --4--\u003e E[commit \u0026 push changes];\n      E --5--\u003e B;\n      B --6--\u003e F[create a pull request];\n      F --7--\u003e A;\n```\n\n\u003cdiv align=\"center\"\u003e\n\n## Contributors\n\n[![][contributors]][contributors-graph]\n\n### Show Some ❤️ by giving ⭐ to the Repository\n\n\u003c/div\u003e\n\n\u003c!----------------------------------{ Images }---------------------------------\u003e\n\n[contributors]: https://contrib.rocks/image?repo=rajput-hemant/leetcode\u0026max=500\n[contributors-graph]: https://github.com/rajput-hemant/leetcode/graphs/contributors\n\n\u003c!--------------------------------{ DeepSource }-------------------------------\u003e\n\n[deepsource]: https://deepsource.io/gh/rajput-hemant/leetcode/?ref=repository-badge\n[active-issues]: https://deepsource.io/gh/rajput-hemant/leetcode.svg/?label=active+issues\u0026showtrend=true\u0026token=IPVIQX-cSuQSVeVl8cb5PLt\n[resolved-issues]: https://deepsource.io/gh/rajput-hemant/leetcode.svg/?label=resolved+issues\u0026showtrend=true\u0026token=IPVIQX-cSuQSVeVl8cb5PLt\n\n\u003c!----------------------------------{ Codacy }---------------------------------\u003e\n\n[codacy]: https://www.codacy.com/gh/rajput-hemant/leetcode/dashboard?utmsource=github.com\u0026utmmedium=referral\u0026utmcontent=rajput-hemant/leetcode\u0026utmcampaign=BadgeGrade\n[code-quality]: https://app.codacy.com/project/badge/Grade/97e3ea868f9344a5aa6e4d874f83db14\n\n\u003c!----------------------------------{ Labels }---------------------------------\u003e\n\n[views]: https://komarev.com/ghpvc/?username=leetcode\u0026label=view%20counter\u0026color=red\u0026style=flat\n[code-size]: https://img.shields.io/github/languages/code-size/rajput-hemant/leetcode\n[issues]: https://img.shields.io/github/issues-raw/rajput-hemant/leetcode\n[license]: https://img.shields.io/github/license/rajput-hemant/leetcode\n[commit-activity]: https://img.shields.io/github/commit-activity/w/rajput-hemant/leetcode\n[forks]: https://img.shields.io/github/forks/rajput-hemant/leetcode?style=flat\n[stars]: https://img.shields.io/github/stars/rajput-hemant/leetcode\n\n\u003c!-----------------------------------{ Mics }----------------------------------\u003e\n\n[leetcode]: https://github.com/rajput-hemant/leetcode\n[topicwise]: ./TOPICWISE.md\n[serialwise]: ./src/README.md\n\n\u003c!----------------------------------{ Topics }---------------------------------\u003e\n\n[array]: ./TOPICWISE.md#array\n[string]: ./TOPICWISE.md#string\n[hash table]: ./TOPICWISE.md#hash-table\n[dynamic programming]: ./TOPICWISE.md#dynamic-programming\n[math]: ./TOPICWISE.md#math\n[sorting]: ./TOPICWISE.md#sorting\n[greedy]: ./TOPICWISE.md#greedy\n[depth-first search]: ./TOPICWISE.md#depth-first-search\n[database]: ./TOPICWISE.md#database\n[breadth-first search]: ./TOPICWISE.md#breadth-first-search\n[tree]: ./TOPICWISE.md#tree\n[binary search]: ./TOPICWISE.md#binary-search\n[matrix]: ./TOPICWISE.md#matrix\n[binary tree]: ./TOPICWISE.md#binary-tree\n[two pointers]: ./TOPICWISE.md#two-pointers\n[bit manipulation]: ./TOPICWISE.md#bit-manipulation\n[stack]: ./TOPICWISE.md#stack\n[heap ]: ./TOPICWISE.md#heap-priority-queue\n[design]: ./TOPICWISE.md#design\n[graph]: ./TOPICWISE.md#graph\n[prefix sum]: ./TOPICWISE.md#prefix-sum\n[simulation]: ./TOPICWISE.md#simulation\n[backtracking]: ./TOPICWISE.md#backtracking\n[counting]: ./TOPICWISE.md#counting\n[sliding window]: ./TOPICWISE.md#sliding-window\n[union find]: ./TOPICWISE.md#union-find\n[linked list]: ./TOPICWISE.md#linked-list\n[ordered set]: ./TOPICWISE.md#ordered-set\n[monotonic stack]: ./TOPICWISE.md#monotonic-stack\n[enumeration]: ./TOPICWISE.md#enumeration\n[recursion]: ./TOPICWISE.md#recursion\n[trie]: ./TOPICWISE.md#trie\n[divide and conquer]: ./TOPICWISE.md#divide-and-conquer\n[binary search tree]: ./TOPICWISE.md#binary-search-tree\n[bitmask]: ./TOPICWISE.md#bitmask\n[queue]: ./TOPICWISE.md#queue\n[memoization]: ./TOPICWISE.md#memoization\n[topological sort]: ./TOPICWISE.md#topological-sort\n[geometry]: ./TOPICWISE.md#geometry\n[segment tree]: ./TOPICWISE.md#segment-tree\n[hash function]: ./TOPICWISE.md#hash-function\n[game theory]: ./TOPICWISE.md#game-theory\n[binary indexed tree]: ./TOPICWISE.md#binary-indexed-tree\n[number theory]: ./TOPICWISE.md#number-theory\n[interactive]: ./TOPICWISE.md#interactive\n[string matching]: ./TOPICWISE.md#string-matching\n[rolling hash]: ./TOPICWISE.md#rolling-hash\n[data stream]: ./TOPICWISE.md#data-stream\n[shortest path]: ./TOPICWISE.md#shortest-path\n[combinatorics]: ./TOPICWISE.md#combinatorics\n[randomized]: ./TOPICWISE.md#randomized\n[monotonic queue]: ./TOPICWISE.md#monotonic-queue\n[brainteaser]: ./TOPICWISE.md#brainteaser\n[merge sort]: ./TOPICWISE.md#merge-sort\n[iterator]: ./TOPICWISE.md#iterator\n[concurrency]: ./TOPICWISE.md#concurrency\n[doubly-linked list]: ./TOPICWISE.md#doubly-linked-list\n[probability and statistics]: ./TOPICWISE.md#probability-and-statistics\n[quickselect]: ./TOPICWISE.md#quickselect\n[bucket sort]: ./TOPICWISE.md#bucket-sort\n[suffix array]: ./TOPICWISE.md#suffix-array\n[minimum spanning tree]: ./TOPICWISE.md#minimum-spanning-tree\n[counting sort]: ./TOPICWISE.md#counting-sort\n[shell]: ./TOPICWISE.md#shell\n[line sweep]: ./TOPICWISE.md#line-sweep\n[reservoir sampling]: ./TOPICWISE.md#reservoir-sampling\n[eulerian circuit]: ./TOPICWISE.md#eulerian-circuit\n[radix sort]: ./TOPICWISE.md#radix-sort\n[strongly connected component]: ./TOPICWISE.md#strongly-connected-component\n[rejection sampling]: ./TOPICWISE.md#rejection-sampling\n[biconnected component]: ./TOPICWISE.md#biconnected-component\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frajput-hemant%2Fleetcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frajput-hemant%2Fleetcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frajput-hemant%2Fleetcode/lists"}