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 }}
Sentious
LeetCode-Solutions
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
LeetCode-Solutions
/
java
/
Copy path
Directory actions
More options
More options
Directory actions
More options
More options
Latest commit
History
History
History
main
Breadcrumbs
LeetCode-Solutions
/
java
/
Copy path
Top
Folders and files
Name
Name
Last commit message
Last commit date
parent directory
..
1-Two-Sum.java
1-Two-Sum.java
10-Regular-Expression-Matching.java
10-Regular-Expression-Matching.java
100-Same-Tree.java
100-Same-Tree.java
102-Binary-Tree-Level-Order-Traversal.java
102-Binary-Tree-Level-Order-Traversal.java
104-Maximum-Depth-of-Binary-Tree.java
104-Maximum-Depth-of-Binary-Tree.java
1046-Last-Stone-Weight.java
1046-Last-Stone-Weight.java
105-Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.java
105-Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.java
106-Construct-Binary-Tree-from-Inorder-and-Postorder-Traversal.java
106-Construct-Binary-Tree-from-Inorder-and-Postorder-Traversal.java
107-Binary-Tree-Level-Order-Traversal-II.java
107-Binary-Tree-Level-Order-Traversal-II.java
11-Container-With-Most-Water.java
11-Container-With-Most-Water.java
110-Balanced-Binary-Tree.java
110-Balanced-Binary-Tree.java
1143-Longest-Common-Subsequence.java
1143-Longest-Common-Subsequence.java
115-Distinct-Subsequences.java
115-Distinct-Subsequences.java
1155-Number-of-Dice-Rolls-With-Target-Sum.java
1155-Number-of-Dice-Rolls-With-Target-Sum.java
1160-Find-Words-That-Can-Be-Formed-by-Characters.java
1160-Find-Words-That-Can-Be-Formed-by-Characters.java
119-Pascal's-Triangle-II.java
119-Pascal's-Triangle-II.java
121-Best-Time-to-Buy-and-Sell-Stock.java
121-Best-Time-to-Buy-and-Sell-Stock.java
124-Binary-Tree-Maximum-Path-Sum.java
124-Binary-Tree-Maximum-Path-Sum.java
125-Valid-Palindrome.java
125-Valid-Palindrome.java
127-Word-Ladder.java
127-Word-Ladder.java
1275-Find-Winner-on-a-Tic-Tac-Toe-Game.java
1275-Find-Winner-on-a-Tic-Tac-Toe-Game.java
128-Longest-Consecutive-Sequence.java
128-Longest-Consecutive-Sequence.java
130-Surrounded-Regions.java
130-Surrounded-Regions.java
131-Palindrome-Partitioning.java
131-Palindrome-Partitioning.java
133-Clone-Graph.java
133-Clone-Graph.java
134-Gas-Station.java
134-Gas-Station.java
136-Single-Number.java
136-Single-Number.java
138-Copy-List-with-Random-Pointer.java
138-Copy-List-with-Random-Pointer.java
139-Word- Break.java
139-Word- Break.java
141. Linked List Cycle.java
141. Linked List Cycle.java
143-Reorder-List.java
143-Reorder-List.java
1448-Count-Good-Nodes-in-Binary-Tree.java
1448-Count-Good-Nodes-in-Binary-Tree.java
146-LRU-Cache.java
146-LRU-Cache.java
15-3Sum.java
15-3Sum.java
150-Evaluate-Reverse-Polish-Notation.java
150-Evaluate-Reverse-Polish-Notation.java
152-Maximum-Product-Subarray.java
152-Maximum-Product-Subarray.java
153-Find-Minimum-in-Rotated-Sorted-Array.java
153-Find-Minimum-in-Rotated-Sorted-Array.java
155-Min-Stack.java
155-Min-Stack.java
1584-Min-Cost-to-Connect-All-Points.java
1584-Min-Cost-to-Connect-All-Points.java
167-Two-Sum-II.java
167-Two-Sum-II.java
17-Letter-Combinations-of-a-Phone-Number.java
17-Letter-Combinations-of-a-Phone-Number.java
1851-Minimum-Interval-to-Include-Each-Query.java
1851-Minimum-Interval-to-Include-Each-Query.java
187-Repeated-DNA-Sequences.java
187-Repeated-DNA-Sequences.java
1899-Merge-Triplets-To-Form-Target-Triplet.java
1899-Merge-Triplets-To-Form-Target-Triplet.java
19-Remove-Nth-Node-From-End-of-List.java
19-Remove-Nth-Node-From-End-of-List.java
190-Reverse-Bits.java
190-Reverse-Bits.java
191-Number-of-1-Bits.java
191-Number-of-1-Bits.java
198-House-Robber.java
198-House-Robber.java
199-Binary-Tree-Right-Side-View.java
199-Binary-Tree-Right-Side-View.java
2-Add-Two-Numbers.java
2-Add-Two-Numbers.java
20-Valid-Parentheses.java
20-Valid-Parentheses.java
200-Number-of-Islands.java
200-Number-of-Islands.java
2013-Detect-Squares.java
2013-Detect-Squares.java
202-Happy-Number.java
202-Happy-Number.java
206. Reverse Linked List.java
206. Reverse Linked List.java
207-Course-Schedule.java
207-Course-Schedule.java
208-Implement-Trie-Prefix-Tree.java
208-Implement-Trie-Prefix-Tree.java
21-Merge-Two-Sorted-Lists.java
21-Merge-Two-Sorted-Lists.java
210-Course-Schedule-II.java
210-Course-Schedule-II.java
211-Design-Add-and-Search-Words-Data-Structure.java
211-Design-Add-and-Search-Words-Data-Structure.java
212-Word-Search-II.java
212-Word-Search-II.java
213-House-Robber-II.java
213-House-Robber-II.java
215-Kth-Largest-Element-in-an-Array.java
215-Kth-Largest-Element-in-an-Array.java
217-Contains-Duplicate.java
217-Contains-Duplicate.java
22-Generate-Parentheses.java
22-Generate-Parentheses.java
226-Invert-Binary-Tree.java
226-Invert-Binary-Tree.java
23-Merge-k-Sorted-Lists.java
23-Merge-k-Sorted-Lists.java
230-Kth-Smallest-Element-in-a-BST.java
230-Kth-Smallest-Element-in-a-BST.java
2309.-Greatest-English-Letter-in-Upper-and-Lower-Case.java
2309.-Greatest-English-Letter-in-Upper-and-Lower-Case.java
2310-Sum-of-Numbers-With-Units-Digit-K.java
2310-Sum-of-Numbers-With-Units-Digit-K.java
2328-Number-of-Increasing-Paths-in-a-Grid.java
2328-Number-of-Increasing-Paths-in-a-Grid.java
234. Palindrome Linked List.java
234. Palindrome Linked List.java
235-Lowest-Common-Ancestor-of-a-Binary-Search-Tree.java
235-Lowest-Common-Ancestor-of-a-Binary-Search-Tree.java
236-Lowest-Common-Ancestor-of-a-Binary-Tree.java
236-Lowest-Common-Ancestor-of-a-Binary-Tree.java
237-delete-node-in-a-linked-list
237-delete-node-in-a-linked-list
238-Product-of-Array-Except-Self.java
238-Product-of-Array-Except-Self.java
239-Sliding-Window-Maximum.java
239-Sliding-Window-Maximum.java
24 Swap Nodes in Pairs.java
24 Swap Nodes in Pairs.java
242-Valid-Anagram.java
242-Valid-Anagram.java
25-Reverse-Nodes-in-k-Group.java
25-Reverse-Nodes-in-k-Group.java
252-Meeting-Rooms.java
252-Meeting-Rooms.java
253-Meeting-Rooms-ii.java
253-Meeting-Rooms-ii.java
261-Graph-Valid-Tree.java
261-Graph-Valid-Tree.java
268-Missing-Number.java
268-Missing-Number.java
269-Alien-Dictionary.java
269-Alien-Dictionary.java
27-Remove-Element.java
27-Remove-Element.java
271-Encode-and-Decode-Strings.java
271-Encode-and-Decode-Strings.java
279-Perfect-Squares.java
279-Perfect-Squares.java
286-Walls-and-Gates.java
286-Walls-and-Gates.java
287-Find-the-Duplicate-Number.java
287-Find-the-Duplicate-Number.java
295-Find-Median-from-Data-Stream.java
295-Find-Median-from-Data-Stream.java
297-Serialize-and-Deserialize-Binary-Tree.java
297-Serialize-and-Deserialize-Binary-Tree.java
3-Longest-Substring-Without-Repeating-Characters.java
3-Longest-Substring-Without-Repeating-Characters.java
300-Longest-Increasing-Subsequence.java
300-Longest-Increasing-Subsequence.java
309-Best-Time-To-Buy-and-Sell-Stock-With-Cooldown.java
309-Best-Time-To-Buy-and-Sell-Stock-With-Cooldown.java
312-Burst-Balloons.java
312-Burst-Balloons.java
322-Coin-Change.java
322-Coin-Change.java
323-Number-of-Connected-Components-in-an-Undirected-Graph.java
323-Number-of-Connected-Components-in-an-Undirected-Graph.java
329-Longest-Increasing-Path-in-a-Matrix.java
329-Longest-Increasing-Path-in-a-Matrix.java
33-Search-In-Rotated-Sorted-Array.java
33-Search-In-Rotated-Sorted-Array.java
View all files
You can’t perform that action at this time.