Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
Accelerator
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Type
/
to search
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
vikasgola
/
leetcode
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
2
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
main
Branches
Tags
Go to file
Code
Open more actions menu
Folders and files
Name
Name
Last commit message
Last commit date
Latest commit
History
7 Commits
7 Commits
.gitignore
.gitignore
1.two-sum.cpp
1.two-sum.cpp
100.same-tree.cpp
100.same-tree.cpp
101.symmetric-tree.cpp
101.symmetric-tree.cpp
1019.squares-of-a-sorted-array.cpp
1019.squares-of-a-sorted-array.cpp
1032.satisfiability-of-equality-equations.cpp
1032.satisfiability-of-equality-equations.cpp
1036.rotting-oranges.cpp
1036.rotting-oranges.cpp
104.maximum-depth-of-binary-tree.cpp
104.maximum-depth-of-binary-tree.cpp
108.convert-sorted-array-to-binary-search-tree.cpp
108.convert-sorted-array-to-binary-search-tree.cpp
11.container-with-most-water.cpp
11.container-with-most-water.cpp
110.balanced-binary-tree.cpp
110.balanced-binary-tree.cpp
111.minimum-depth-of-binary-tree.cpp
111.minimum-depth-of-binary-tree.cpp
112.path-sum.cpp
112.path-sum.cpp
1137.height-checker.cpp
1137.height-checker.cpp
1146.greatest-common-divisor-of-strings.cpp
1146.greatest-common-divisor-of-strings.cpp
118.pascals-triangle.cpp
118.pascals-triangle.cpp
1187.print-foobar-alternately.cpp
1187.print-foobar-alternately.cpp
119.pascals-triangle-ii.cpp
119.pascals-triangle-ii.cpp
12.integer-to-roman.cpp
12.integer-to-roman.cpp
121.best-time-to-buy-and-sell-stock.cpp
121.best-time-to-buy-and-sell-stock.cpp
1236.n-th-tribonacci-number.cpp
1236.n-th-tribonacci-number.cpp
125.valid-palindrome.cpp
125.valid-palindrome.cpp
127.word-ladder.cpp
127.word-ladder.cpp
128.longest-consecutive-sequence.cpp
128.longest-consecutive-sequence.cpp
13.roman-to-integer.cpp
13.roman-to-integer.cpp
1320.remove-all-adjacent-duplicates-in-string-ii.cpp
1320.remove-all-adjacent-duplicates-in-string-ii.cpp
136.single-number.cpp
136.single-number.cpp
1380.number-of-closed-islands.cpp
1380.number-of-closed-islands.cpp
14.longest-common-prefix.cpp
14.longest-common-prefix.cpp
141.linked-list-cycle.cpp
141.linked-list-cycle.cpp
144.binary-tree-preorder-traversal.cpp
144.binary-tree-preorder-traversal.cpp
145.binary-tree-postorder-traversal.cpp
145.binary-tree-postorder-traversal.cpp
1491.number-of-times-binary-string-is-prefix-aligned.cpp
1491.number-of-times-binary-string-is-prefix-aligned.cpp
15.3sum.cpp
15.3sum.cpp
150.evaluate-reverse-polish-notation.cpp
150.evaluate-reverse-polish-notation.cpp
151.reverse-words-in-a-string.cpp
151.reverse-words-in-a-string.cpp
1528.kids-with-the-greatest-number-of-candies.cpp
1528.kids-with-the-greatest-number-of-candies.cpp
1548.check-if-all-1s-are-at-least-length-k-places-away.cpp
1548.check-if-all-1s-are-at-least-length-k-places-away.cpp
155.min-stack.cpp
155.min-stack.cpp
1570.final-prices-with-a-special-discount-in-a-shop.cpp
1570.final-prices-with-a-special-discount-in-a-shop.cpp
1585.the-kth-factor-of-n.cpp
1585.the-kth-factor-of-n.cpp
16.3sum-closest.cpp
16.3sum-closest.cpp
160.intersection-of-two-linked-lists.cpp
160.intersection-of-two-linked-lists.cpp
167.two-sum-ii-input-array-is-sorted.cpp
167.two-sum-ii-input-array-is-sorted.cpp
168.excel-sheet-column-title.cpp
168.excel-sheet-column-title.cpp
169.majority-element.cpp
169.majority-element.cpp
17.letter-combinations-of-a-phone-number.cpp
17.letter-combinations-of-a-phone-number.cpp
171.excel-sheet-column-number.cpp
171.excel-sheet-column-number.cpp
1738.maximal-network-rank.cpp
1738.maximal-network-rank.cpp
18.4sum.cpp
18.4sum.cpp
1834.minimum-number-of-people-to-teach.cpp
1834.minimum-number-of-people-to-teach.cpp
189.rotate-array.cpp
189.rotate-array.cpp
1894.merge-strings-alternately.cpp
1894.merge-strings-alternately.cpp
19.remove-nth-node-from-end-of-list.cpp
19.remove-nth-node-from-end-of-list.cpp
190.reverse-bits.cpp
190.reverse-bits.cpp
191.number-of-1-bits.cpp
191.number-of-1-bits.cpp
1983.maximum-population-year.cpp
1983.maximum-population-year.cpp
2.add-two-numbers.cpp
2.add-two-numbers.cpp
20.valid-parentheses.cpp
20.valid-parentheses.cpp
2000.minimum-speed-to-arrive-on-time.cpp
2000.minimum-speed-to-arrive-on-time.cpp
2017.minimum-number-of-flips-to-make-the-binary-string-alternating.cpp
2017.minimum-number-of-flips-to-make-the-binary-string-alternating.cpp
202.happy-number.cpp
202.happy-number.cpp
2025.redistribute-characters-to-make-all-strings-equal.cpp
2025.redistribute-characters-to-make-all-strings-equal.cpp
2099.number-of-strings-that-appear-as-substrings-in-word.cpp
2099.number-of-strings-that-appear-as-substrings-in-word.cpp
21.merge-two-sorted-lists.cpp
21.merge-two-sorted-lists.cpp
2164.two-best-non-overlapping-events.cpp
2164.two-best-non-overlapping-events.cpp
2176.parallel-courses-iii.cpp
2176.parallel-courses-iii.cpp
219.contains-duplicate-ii.cpp
219.contains-duplicate-ii.cpp
22.generate-parentheses.cpp
22.generate-parentheses.cpp
228.summary-ranges.cpp
228.summary-ranges.cpp
232.implement-queue-using-stacks.cpp
232.implement-queue-using-stacks.cpp
236.lowest-common-ancestor-of-a-binary-tree.py
236.lowest-common-ancestor-of-a-binary-tree.py
24.swap-nodes-in-pairs.cpp
24.swap-nodes-in-pairs.cpp
2459.minimum-hours-of-training-to-win-a-competition.cpp
2459.minimum-hours-of-training-to-win-a-competition.cpp
2469.longest-subsequence-with-limited-sum.cpp
2469.longest-subsequence-with-limited-sum.cpp
2470.removing-stars-from-a-string.cpp
2470.removing-stars-from-a-string.cpp
2471.minimum-amount-of-time-to-collect-garbage.cpp
2471.minimum-amount-of-time-to-collect-garbage.cpp
2472.build-a-matrix-with-conditions.cpp
2472.build-a-matrix-with-conditions.cpp
2475.largest-palindromic-number.cpp
2475.largest-palindromic-number.cpp
2476.check-distances-between-same-letters.cpp
2476.check-distances-between-same-letters.cpp
2480.find-subarrays-with-equal-sum.cpp
2480.find-subarrays-with-equal-sum.cpp
2481.strictly-palindromic-number.cpp
2481.strictly-palindromic-number.cpp
2492.length-of-the-longest-alphabetical-continuous-substring.cpp
2492.length-of-the-longest-alphabetical-continuous-substring.cpp
2511.partition-string-into-substrings-with-values-at-most-k.cpp
2511.partition-string-into-substrings-with-values-at-most-k.cpp
26.remove-duplicates-from-sorted-array.cpp
26.remove-duplicates-from-sorted-array.cpp
268.missing-number.cpp
268.missing-number.cpp
27.remove-element.cpp
27.remove-element.cpp
28.find-the-index-of-the-first-occurrence-in-a-string.cpp
28.find-the-index-of-the-first-occurrence-in-a-string.cpp
28.implement-str-str.cpp
28.implement-str-str.cpp
295.find-median-from-data-stream.cpp
295.find-median-from-data-stream.cpp
297.serialize-and-deserialize-binary-tree.cpp
297.serialize-and-deserialize-binary-tree.cpp
3.longest-substring-without-repeating-characters.cpp
3.longest-substring-without-repeating-characters.cpp
31.next-permutation.cpp
31.next-permutation.cpp
33.search-in-rotated-sorted-array.cpp
33.search-in-rotated-sorted-array.cpp
34.find-first-and-last-position-of-element-in-sorted-array.cpp
34.find-first-and-last-position-of-element-in-sorted-array.cpp
345.reverse-vowels-of-a-string.cpp
345.reverse-vowels-of-a-string.cpp
35.search-insert-position.cpp
35.search-insert-position.cpp
36.valid-sudoku.cpp
36.valid-sudoku.cpp
38.count-and-say.cpp
38.count-and-say.cpp
39.combination-sum.cpp
39.combination-sum.cpp
View all files
Repository files navigation
README
More
items
leetcode
solutions of leetcode problems
About
solutions of leetcode problems
Topics
cpp
leetcode
leetcode-cpp
leetcode-cpp-solutions
leetcode-solutions
Resources
Readme
Activity
Stars
2
stars
Watchers
1
watching
Forks
0
forks
Report repository
Releases
Packages
Contributors
Languages
You can’t perform that action at this time.