Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects, and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Developer articles
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Small and medium teams
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
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 }}
AlgorithmsWorld
JavaAlgosSet2
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
JavaAlgosSet2
/
src
/
main
/
java
/
leetcode
/
medium
/
Copy path
Directory actions
More options
More options
Directory actions
More options
More options
Latest commit
History
History
History
master
Breadcrumbs
JavaAlgosSet2
/
src
/
main
/
java
/
leetcode
/
medium
/
Copy path
Top
Folders and files
Name
Name
Last commit message
Last commit date
parent directory
..
ArithmeticSlices.java
ArithmeticSlices.java
BattleshipsInABoard.java
BattleshipsInABoard.java
BestTimeToBuyAndSellStockII.java
BestTimeToBuyAndSellStockII.java
BestTimeToBuyAndSellStockWithCooldown.java
BestTimeToBuyAndSellStockWithCooldown.java
BinaryTreeInorderTraversal.java
BinaryTreeInorderTraversal.java
BinaryTreePreorderTraversal.java
BinaryTreePreorderTraversal.java
BitwiseAndOfNumbersRange.java
BitwiseAndOfNumbersRange.java
BulbSwitcher.java
BulbSwitcher.java
CombinationSumIII.java
CombinationSumIII.java
CombinationSumIV.java
CombinationSumIV.java
Combinations.java
Combinations.java
ConvertSortedArrayToBinarySearchTree.java
ConvertSortedArrayToBinarySearchTree.java
CountNumbersWithUniqueDigits.java
CountNumbersWithUniqueDigits.java
CountingBits.java
CountingBits.java
DecodeString.java
DecodeString.java
DeleteNodeInABST.java
DeleteNodeInABST.java
DifferentWaysToAddParentheses.java
DifferentWaysToAddParentheses.java
EliminationGame.java
EliminationGame.java
EvaluateDivision.java
EvaluateDivision.java
FindMinimumInRotatedSortedArray.java
FindMinimumInRotatedSortedArray.java
FindPeakElement.java
FindPeakElement.java
FindRightInterval.java
FindRightInterval.java
FlattenBinaryTreeToLinkedList.java
FlattenBinaryTreeToLinkedList.java
FourSumII.java
FourSumII.java
GameOfLife.java
GameOfLife.java
GrayCode.java
GrayCode.java
GuessNumberHigherOrLowerII.java
GuessNumberHigherOrLowerII.java
HIndex.java
HIndex.java
HIndexII.java
HIndexII.java
HouseRobberIII.java
HouseRobberIII.java
IncreasingTripletSubsequence.java
IncreasingTripletSubsequence.java
IntegerBreak.java
IntegerBreak.java
IsSubsequence.java
IsSubsequence.java
JumpGame.java
JumpGame.java
KthLargestElementInAnArray.java
KthLargestElementInAnArray.java
KthSmallestElementInABST.java
KthSmallestElementInABST.java
KthSmallestElementInASortedMatrix.java
KthSmallestElementInASortedMatrix.java
LargestDivisibleSubset.java
LargestDivisibleSubset.java
LinkedListRandomNode.java
LinkedListRandomNode.java
LongestAbsoluteFilePath.java
LongestAbsoluteFilePath.java
LongestRepeatingCharacterReplacement.java
LongestRepeatingCharacterReplacement.java
LongestSubstringWithAtLeastKRepeatingCharacters.java
LongestSubstringWithAtLeastKRepeatingCharacters.java
MaximumProductOfWordLengths.java
MaximumProductOfWordLengths.java
MaximumProductSubarray.java
MaximumProductSubarray.java
MaximumXOROfTwoNumbersInAnArray.java
MaximumXOROfTwoNumbersInAnArray.java
MinimumNumberOfArrowsToBurstBalloons.java
MinimumNumberOfArrowsToBurstBalloons.java
MissingNumber.java
MissingNumber.java
NonOverlappingIntervals.java
NonOverlappingIntervals.java
NumberOfIslands.java
NumberOfIslands.java
OddEvenLinkedList.java
OddEvenLinkedList.java
OnesAndZeroes.java
OnesAndZeroes.java
PartitionEqualSubsetSum.java
PartitionEqualSubsetSum.java
PopulatingNextRightPointersInEachNode.java
PopulatingNextRightPointersInEachNode.java
ProductOfArrayExceptSelf.java
ProductOfArrayExceptSelf.java
QueueReconstructionByHeight.java
QueueReconstructionByHeight.java
ReconstructOriginalDigitsFromEnglish.java
ReconstructOriginalDigitsFromEnglish.java
RemoveDuplicatesFromSortedArray.java
RemoveDuplicatesFromSortedArray.java
RemoveDuplicatesFromSortedArrayII.java
RemoveDuplicatesFromSortedArrayII.java
SearchA2DMatrix.java
SearchA2DMatrix.java
SearchA2DMatrixII.java
SearchA2DMatrixII.java
SearchInRotatedSortedArrayII.java
SearchInRotatedSortedArrayII.java
ShuffleAnArray.java
ShuffleAnArray.java
SingleNumberII.java
SingleNumberII.java
SingleNumberIII.java
SingleNumberIII.java
SortColors.java
SortColors.java
Subsets.java
Subsets.java
SubsetsII.java
SubsetsII.java
SumRootToLeafNumbers.java
SumRootToLeafNumbers.java
SuperUglyNumber.java
SuperUglyNumber.java
SurroundedRegions.java
SurroundedRegions.java
TopKFrequentElements.java
TopKFrequentElements.java
TwoSumIIInputArraySorted.java
TwoSumIIInputArraySorted.java
UTF8Validation.java
UTF8Validation.java
UglyNumberII.java
UglyNumberII.java
UniqueBinarySearchTrees.java
UniqueBinarySearchTrees.java
ValidPerfectSquare.java
ValidPerfectSquare.java
VerifyPreorderSerializationOfABinaryTree.java
VerifyPreorderSerializationOfABinaryTree.java
WiggleSubsequence.java
WiggleSubsequence.java
View all files
You can’t perform that action at this time.