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
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 }}
Pthinker
/
algorithm_java
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Issues
0
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Files
Expand file tree
master
Breadcrumbs
algorithm_java
/
leetcode
/
Copy path
Directory actions
More options
More options
Directory actions
More options
More options
Latest commit
History
History
History
master
Breadcrumbs
algorithm_java
/
leetcode
/
Copy path
Top
Folders and files
Name
Name
Last commit message
Last commit date
parent directory
..
.DS_Store
.DS_Store
132-pattern.java
132-pattern.java
3Sum.java
3Sum.java
3Sum_Smaller.java
3Sum_Smaller.java
3sum-closest.java
3sum-closest.java
4Sum.java
4Sum.java
4sum-ii.java
4sum-ii.java
Add_Two_Numbers.java
Add_Two_Numbers.java
Alien_Dictionary.java
Alien_Dictionary.java
Anagrams.java
Anagrams.java
Android_Unlock_Patterns.java
Android_Unlock_Patterns.java
Balanced_Binary_Tree.java
Balanced_Binary_Tree.java
Best_Meeting_Point.java
Best_Meeting_Point.java
Best_Time_to_Buy_and_Sell_Stock_II.java
Best_Time_to_Buy_and_Sell_Stock_II.java
Best_Time_to_Buy_and_Sell_Stock_III.java
Best_Time_to_Buy_and_Sell_Stock_III.java
Binary Tree Longest Consecutive Sequence.java
Binary Tree Longest Consecutive Sequence.java
Binary_Tree_Inorder_Traversal.java
Binary_Tree_Inorder_Traversal.java
Binary_Tree_Level_Order_Traversal.java
Binary_Tree_Level_Order_Traversal.java
Binary_Tree_Level_Order_Traversal_II.java
Binary_Tree_Level_Order_Traversal_II.java
Binary_Tree_Maximum_Path_Sum.java
Binary_Tree_Maximum_Path_Sum.java
Binary_Tree_Upside_Down.java
Binary_Tree_Upside_Down.java
Binary_Tree_Vertical_Order_Traversal.java
Binary_Tree_Vertical_Order_Traversal.java
Binary_Tree_Zigzag_Level_Order_Traversal.java
Binary_Tree_Zigzag_Level_Order_Traversal.java
Bomb_Enemy.java
Bomb_Enemy.java
Climbing_Stairs.java
Climbing_Stairs.java
Closest Binary Search Tree Value II.java
Closest Binary Search Tree Value II.java
Closest_Binary_Search_Tree_Value.java
Closest_Binary_Search_Tree_Value.java
Combination_Sum.java
Combination_Sum.java
Combination_Sum_II.java
Combination_Sum_II.java
Combinations.java
Combinations.java
Construct_Binary_Tree_from_Inorder_and_Postorder_Traversal.java
Construct_Binary_Tree_from_Inorder_and_Postorder_Traversal.java
Construct_Binary_Tree_from_Preorder_and_Inorder_Traversal.java
Construct_Binary_Tree_from_Preorder_and_Inorder_Traversal.java
Container_With_Most_Water.java
Container_With_Most_Water.java
Continuous Subarray Sum.java
Continuous Subarray Sum.java
Convert_Sorted_Array_to_Binary_Search_Tree.java
Convert_Sorted_Array_to_Binary_Search_Tree.java
Convert_Sorted_List_to_Binary_Search_Tree.java
Convert_Sorted_List_to_Binary_Search_Tree.java
Convex_Polygon.java
Convex_Polygon.java
Count_Univalue_Subtrees.java
Count_Univalue_Subtrees.java
Count_and_Say.java
Count_and_Say.java
Decode_Ways.java
Decode_Ways.java
Design_Hit_Counter.java
Design_Hit_Counter.java
Design_Phone_Directory.java
Design_Phone_Directory.java
Design_Snake_Game.java
Design_Snake_Game.java
Design_Tic-Tac-Toe.java
Design_Tic-Tac-Toe.java
Divide_Two_Integers.java
Divide_Two_Integers.java
Encode String with Shortest Length.java
Encode String with Shortest Length.java
Encode_and_Decode_Strings.java
Encode_and_Decode_Strings.java
Factor_Combinations.java
Factor_Combinations.java
Find_Leaves_of_Binary_Tree.java
Find_Leaves_of_Binary_Tree.java
Find_Permutation.java
Find_Permutation.java
Find_the_Celebrity.java
Find_the_Celebrity.java
First_Missing_Positive.java
First_Missing_Positive.java
Flatten_2D_Vector.java
Flatten_2D_Vector.java
Flip_Game_II.java
Flip_Game_II.java
Generalized_Abbreviation.java
Generalized_Abbreviation.java
Generate_Parentheses.java
Generate_Parentheses.java
Graph_Valid_Tree.java
Graph_Valid_Tree.java
Group_Anagrams.java
Group_Anagrams.java
Group_Shifted_Strings.java
Group_Shifted_Strings.java
HappyNumber.java
HappyNumber.java
House_Robber.java
House_Robber.java
Implement_strStr.java
Implement_strStr.java
Inorder_Successor_in_BST.java
Inorder_Successor_in_BST.java
Insert_Interval.java
Insert_Interval.java
Integer_to_Roman.java
Integer_to_Roman.java
Interleaving_String.java
Interleaving_String.java
Jump_Game.java
Jump_Game.java
Jump_Game_II.java
Jump_Game_II.java
Largest_BST_Subtree.java
Largest_BST_Subtree.java
Largest_Rectangle_in_Histogram.java
Largest_Rectangle_in_Histogram.java
Letter_Combinations_of_a_Phone_Number.java
Letter_Combinations_of_a_Phone_Number.java
Line-Reflection.java
Line-Reflection.java
Logger_Rate_Limiter.java
Logger_Rate_Limiter.java
Longest Substring with At Most K Distinct Characters.java
Longest Substring with At Most K Distinct Characters.java
Longest Substring with At Most Two Distinct Characters.java
Longest Substring with At Most Two Distinct Characters.java
Longest_Common_Prefix.java
Longest_Common_Prefix.java
Longest_Consecutive_Sequence.java
Longest_Consecutive_Sequence.java
Longest_Substring_Without_Repeating_Characters.java
Longest_Substring_Without_Repeating_Characters.java
Longest_Valid_Parentheses.java
Longest_Valid_Parentheses.java
Max_Consecutive_Ones_II.java
Max_Consecutive_Ones_II.java
Maximal_Rectangle.java
Maximal_Rectangle.java
Maximum_Depth_of_Binary_Tree.java
Maximum_Depth_of_Binary_Tree.java
Maximum_Size_Subarray_Sum_Equals_k.java
Maximum_Size_Subarray_Sum_Equals_k.java
Median_of_Two_Sorted_Arrays.java
Median_of_Two_Sorted_Arrays.java
Meeting_Rooms.java
Meeting_Rooms.java
Meeting_Rooms_II.java
Meeting_Rooms_II.java
Merge_Intervals.java
Merge_Intervals.java
Merge_Sorted_Array.java
Merge_Sorted_Array.java
Merge_Two_Sorted_Lists.java
Merge_Two_Sorted_Lists.java
Merge_k_Sorted_Lists.java
Merge_k_Sorted_Lists.java
Minimum Unique Word Abbreviation.java
Minimum Unique Word Abbreviation.java
Minimum_Depth_of_Binary_Tree.java
Minimum_Depth_of_Binary_Tree.java
Minimum_Path_Sum.java
Minimum_Path_Sum.java
Missing_Ranges.java
Missing_Ranges.java
Moving_Average_from_Data_Stream.java
Moving_Average_from_Data_Stream.java
Nested_List_Weight_Sum.java
Nested_List_Weight_Sum.java
Nested_List_Weight_Sum_II.java
Nested_List_Weight_Sum_II.java
Next_Permutation.java
Next_Permutation.java
Number of Connected Components in an Undirected Graph.java
Number of Connected Components in an Undirected Graph.java
Number-of-Islands-II.java
Number-of-Islands-II.java
View all files
You can’t perform that action at this time.