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
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
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 }}
afroCoderHanane
/
leetcode-1
Public
forked from
neetcode-gh/leetcode
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Files
Expand file tree
main
Breadcrumbs
leetcode-1
/
cpp
/
Copy path
Directory actions
More options
More options
Directory actions
More options
More options
Latest commit
History
History
History
main
Breadcrumbs
leetcode-1
/
cpp
/
Copy path
Top
Folders and files
Name
Name
Last commit message
Last commit date
parent directory
..
neetcode_150
neetcode_150
1-Two-Sum.cpp
1-Two-Sum.cpp
10-Regular-Expression-Matching.cpp
10-Regular-Expression-Matching.cpp
100-Same-Tree.cpp
100-Same-Tree.cpp
102-Binary-Tree-Level-Order-Traversal.cpp
102-Binary-Tree-Level-Order-Traversal.cpp
104-Maximum-Depth-Of-Binary-Tree.cpp
104-Maximum-Depth-Of-Binary-Tree.cpp
1046-Last-Stone-Weight.cpp
1046-Last-Stone-Weight.cpp
105-Construct-Binary-Tree-From-Preorder-And-Inorder.cpp
105-Construct-Binary-Tree-From-Preorder-And-Inorder.cpp
11-Container-With-Most-Water.cpp
11-Container-With-Most-Water.cpp
110-Balanced-Binary-Tree.cpp
110-Balanced-Binary-Tree.cpp
1143-Longest-Common-Subsequence.cpp
1143-Longest-Common-Subsequence.cpp
115-Distinct-Subsequences.cpp
115-Distinct-Subsequences.cpp
120-Triangle.cpp
120-Triangle.cpp
1209-Remove-All-Adjacent-Duplicates-in-String-II.cpp
1209-Remove-All-Adjacent-Duplicates-in-String-II.cpp
121-Best-Time-To-Buy-And-Sell-Stock.cpp
121-Best-Time-To-Buy-And-Sell-Stock.cpp
1213-Maximum-Product-Difference-Between-Two-Pairs.cpp
1213-Maximum-Product-Difference-Between-Two-Pairs.cpp
124-Binary-Tree-Maximum-Path-Sum.cpp
124-Binary-Tree-Maximum-Path-Sum.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
1299-Replace-Elements-with-Greatest-Element-on-Right-Side.cpp
1299-Replace-Elements-with-Greatest-Element-on-Right-Side.cpp
130-Surrounded-Regions.cpp
130-Surrounded-Regions.cpp
131-Palindrome-Partitioning.cpp
131-Palindrome-Partitioning.cpp
133-Clone-Graph.cpp
133-Clone-Graph.cpp
134-Gas-Station.cpp
134-Gas-Station.cpp
136-Single-Number.cpp
136-Single-Number.cpp
138-Copy-List-With-Random-Pointer.cpp
138-Copy-List-With-Random-Pointer.cpp
139-Word-Break.cpp
139-Word-Break.cpp
14-4Sum.cpp
14-4Sum.cpp
141-Linked-List-Cycle.cpp
141-Linked-List-Cycle.cpp
143-Reorder-List.cpp
143-Reorder-List.cpp
1448-Count-Good-Nodes-In-Binary-Tree.cpp
1448-Count-Good-Nodes-In-Binary-Tree.cpp
146-Lru-Cache.cpp
146-Lru-Cache.cpp
15-3sum.cpp
15-3sum.cpp
150-Evaluate-Reverse-Polish-Notation.cpp
150-Evaluate-Reverse-Polish-Notation.cpp
1512-Number-Of-Good-Pairs.cpp
1512-Number-Of-Good-Pairs.cpp
152-Maximum-Product-Subarray.cpp
152-Maximum-Product-Subarray.cpp
153-Find-Minimum-In-Rotated-Sorted-Array.cpp
153-Find-Minimum-In-Rotated-Sorted-Array.cpp
155-Min-Stack.cpp
155-Min-Stack.cpp
1584-Min-Cost-To-Connect-All-Points.cpp
1584-Min-Cost-To-Connect-All-Points.cpp
167-Two-Sum-II.cpp
167-Two-Sum-II.cpp
17-Letter-Combinations-Phone-Number.cpp
17-Letter-Combinations-Phone-Number.cpp
1851-Minimum-Interval-To-Include-Each-Query.cpp
1851-Minimum-Interval-To-Include-Each-Query.cpp
189-Rotate-Array.cpp
189-Rotate-Array.cpp
1899-Merge-Triplets-To-Form-Target-Triplet.cpp
1899-Merge-Triplets-To-Form-Target-Triplet.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
1920-Build-Array-From-Permutation.cpp
1920-Build-Array-From-Permutation.cpp
1929-Cocatenation-Of-Array.cpp
1929-Cocatenation-Of-Array.cpp
198-House-Robber.cpp
198-House-Robber.cpp
199-Binary-Tree-Right-Side-View.cpp
199-Binary-Tree-Right-Side-View.cpp
2-Add-Two-Numbers.cpp
2-Add-Two-Numbers.cpp
20-Valid-Parentheses.cpp
20-Valid-Parentheses.cpp
20-Valid-Parenthesis-String.cpp
20-Valid-Parenthesis-String.cpp
200-Number-Of-Islands.cpp
200-Number-Of-Islands.cpp
2013-Detect-Squares.cpp
2013-Detect-Squares.cpp
202-Happy-Number.cpp
202-Happy-Number.cpp
206-Reverse-Linked-List.cpp
206-Reverse-Linked-List.cpp
207-Course-Schedule.cpp
207-Course-Schedule.cpp
208-Implement-Trie-Prefix-Tree.cpp
208-Implement-Trie-Prefix-Tree.cpp
209-Minimum-Size-Subarray-Sum.cpp
209-Minimum-Size-Subarray-Sum.cpp
21-Merge-Two-Sorted-Lists.cpp
21-Merge-Two-Sorted-Lists.cpp
210-Course-Schedule-II.cpp
210-Course-Schedule-II.cpp
211-Design-Add-And-Search-Words-Data-Structure.cpp
211-Design-Add-And-Search-Words-Data-Structure.cpp
212-Word-Search-II.cpp
212-Word-Search-II.cpp
213-House-Robber-II.cpp
213-House-Robber-II.cpp
215-Kth-Largest-Element-In-Array.cpp
215-Kth-Largest-Element-In-Array.cpp
217-Contains-Duplicate.cpp
217-Contains-Duplicate.cpp
22-Generate-Parentheses.cpp
22-Generate-Parentheses.cpp
2235-Add-Two-Integers.cpp
2235-Add-Two-Integers.cpp
226-Invert-Binary-Tree.cpp
226-Invert-Binary-Tree.cpp
23-Merge-K-Sorted-Lists.cpp
23-Merge-K-Sorted-Lists.cpp
230-Kth-Smallest-Element-In-A-Bst.cpp
230-Kth-Smallest-Element-In-A-Bst.cpp
2315-Count-Asterisks.cpp
2315-Count-Asterisks.cpp
234-Palindrome-Linked-List.cpp
234-Palindrome-Linked-List.cpp
235-Lowest-Common-Ancestor-Of-A-Binary-Search-Tree.cpp
235-Lowest-Common-Ancestor-Of-A-Binary-Search-Tree.cpp
236-Power-Of-Three.cpp
236-Power-Of-Three.cpp
238-Product-Of-Array-Except-Self.cpp
238-Product-Of-Array-Except-Self.cpp
239-Sliding-Window-Maximum.cpp
239-Sliding-Window-Maximum.cpp
242-Valid-Anagram-Hashmap.cpp
242-Valid-Anagram-Hashmap.cpp
242-Valid-Anagram.cpp
242-Valid-Anagram.cpp
25-Reverse-Nodes-In-K-Group.cpp
25-Reverse-Nodes-In-K-Group.cpp
252-Meeting-Rooms.cpp
252-Meeting-Rooms.cpp
253-Meeting-Rooms-II.cpp
253-Meeting-Rooms-II.cpp
261-Graph-Valid-Tree.cpp
261-Graph-Valid-Tree.cpp
268-Missing-Number.cpp
268-Missing-Number.cpp
269-Alien-Dictionary.cpp
269-Alien-Dictionary.cpp
271-Encode-And-Decode-Strings.cpp
271-Encode-And-Decode-Strings.cpp
278-First-Bad-Version.cpp
278-First-Bad-Version.cpp
286-Walls-And-Gates.cpp
286-Walls-And-Gates.cpp
287-Find-The-Duplicate-Number.cpp
287-Find-The-Duplicate-Number.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
300-Longest-Increasing-Subsequence.cpp
300-Longest-Increasing-Subsequence.cpp
309-Best-Time-To-Buy-And-Sell-Stock-With-Cooldown.cpp
309-Best-Time-To-Buy-And-Sell-Stock-With-Cooldown.cpp
312-Burst-Balloons.cpp
312-Burst-Balloons.cpp
322-Coin-Change.cpp
322-Coin-Change.cpp
323-Number-Of-Connected-Components-In-An-Undirected-Graph.cpp
323-Number-Of-Connected-Components-In-An-Undirected-Graph.cpp
View all files
You can’t perform that action at this time.